Hello I was wondering what is wrong with this PINVOKE declaration? I am not finding the mistake.
This is the Code in C++
BOOL HOOKDLL_API WINAPI SetHook(int HookType, BOOL bInstall,
DWORD dwThreadId = 0,
HWND hWndCaller = NULL);
This is my declaration:
[
DllImport("CppHookDll.dll", CharSet = CharSet.Auto,
//EntryPoint="?SetHook@@YGHHHKPAUHWND__@@@Z",
EntryPoint = "SetKeyboardHook",
ExactSpelling = true,CallingConvention=CallingConvention.StdCall)
]
public static extern bool SetHook(int HookType, bool bInstall, [MarshalAs(UnmanagedType.U4)] UInt32 dwThreadId, IntPtr hWndCaller);
Thankt in advance.