0
我试图获得使用GetCursorPos我的光标的位置,但它给我的错误光标位置给PInvokeStackImbalance错误
Managed Debugging Assistant 'PInvokeStackImbalance' : 'A call to PInvoke function 'MoveClickApp!MoveClickApp.Module1::GetCursorPos' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.'
我无法弄清楚这意味着什么或如何进行。有任何想法吗?
Public Declare Function GetCursorPos Lib "user32" (ByVal lpPoint As POINTAPI) As UInt32
Public Structure POINTAPI
Dim x As UInt32
Dim y As UInt32
End Structure
Public Function GetX() As UInt32
Dim n As POINTAPI
GetCursorPos(n)
GetX = n.x
End Function
Public Function GetY() As UInt32
Dim n As POINTAPI
GetCursorPos(n)
GetY = n.y
End Function
替代这种方法也可以,你也应该使用Integer
类型x和y,不UINT32赞赏
这有帮助!我实际上没有看到这些<>命令不是编组vb之前,所以这是我需要查找完全理解。奇怪的是,这个修复程序使得一个无关的SetCursorPos命令现在发生了故障,但我会尝试自己弄清楚。谢谢您的帮助 – Zyzyx