试图让它发挥作用 使用VisualStudio VC ++我试图检测光标的位置,同时使用x和y并将其用作东西,但无论如何 - 发生链接错误。
public: System::Void pictureDrag_MouseDown(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) {
POINT coord;
GetCursorPos(&coord);
int xx = coord.x, yy = coord.y;
pictureBox2->Location = Drawing::Point(xx, yy);
}
获取这两个链接错误
Stuff.obj : error LNK2028: unresolved token (0A000011) "extern "C" int __stdcall GetCursorPos(struct tagPOINT *)" (?GetCursorPos@@$$J14YGHPAUtagPOINT@@@Z) referenced in function "public: void __clrcall Stuff::Form1::pictureDrag_MouseDown(class System::Object ^,class System::Windows::Forms::MouseEventArgs ^)" (?pictureDrag_MouseDown@Form1@Stuff@@$$FQ$AAMXP$AAVObject@System@@P$AAVMouseEventArgs@Forms@Windows@4@@Z)
Stuff.obj : error LNK2019: unresolved external symbol "extern "C" int __stdcall GetCursorPos(struct tagPOINT *)" (?GetCursorPos@@$$J14YGHPAUtagPOINT@@@Z) referenced in function "public: void __clrcall Stuff::Form1::pictureDrag_MouseDown(class System::Object ^,class System::Windows::Forms::MouseEventArgs ^)" (?pictureDrag_MouseDown@Form1@Stuff@@$$FQ$AAMXP$AAVObject@System@@P$AAVMouseEventArgs@Forms@Windows@4@@Z)
请注意,有一个 #包括 在开始时我也尝试将user32.lib包含在项目中,根本没有结果。代码本身很容易错过一些大的东西,看起来我忘了包含一些东西,但只是无法弄清楚是什么。我是C ++的新手,我们很快就会分手!我一想到这个。
搜索世界寻求帮助,不能再忍受了。请帮助一个白痴!