GetCaretPos
I am writing some codes in Visual C++ 2005 which I need to import the function GetCaretPos in user32.dll. I tried this:
using namespace System::Runtime::InteropServices;
namespace SysWin32
{
[DllImport("user32.dll", EntryPoint="GetCaretPos", SetLastError = true,
CharSet = CharSet::Unicode, ExactSpelling = true,
CallingConvention = CallingConvention::StdCall)]
bool GetCaretPos(Point lpPoint);
}
However, when I use the function in my code:
Point MyPoint;
SysWin32::GetCaretPos(MyPoint);
I get an error saying: A call to PInvoke function has unbalanced the stack. This is likely because the managed Invoke signature does not match the unmanaged target signature...
How do I declare that function properly?
Best regards,
zion

