用VB做的标准dll(用了标准dll插件),鼠标移动函数代码如下
Function yidong() As Integer
MoveMouse 777, 777
End Function
VC++ 中调用:
HINSTANCE hinstDLL=NULL;
hinstDLL=LoadLibrary("TestDLL.dll");
if (hinstDLL)
{
Connect Proc;
Proc = (Connect)GetProcAddress(hinstDLL,"yidong");
Proc();
FreeLibrary(hinstDLL);
}
else
{
AfxMessageBox("Not found dll");
}
鼠标是移动了后弹出错误(看图):