S
SteveV
I'm trying to create a native c++ dll so that I can hook keyboard
messages and forward them to my compact frame work MessageWindow.
Here's a code snippet from my dll:
VOLUMEHOOK_API bool InitHook(HWND hMsgWnd, HINSTANCE hMod)
{
ghMessageWnd = hMsgWnd;
ghHook = SetWindowsHookEx(WH_KEYBOARD_LL, &LowLevelKeyboardProc,
(HINSTANCE)hMod, 0);
return ghHook != NULL;
}
When I try to compile the project I get the following errors:
error C2065: 'SetWindowsHookEx' : undeclared identifier
error C2440: '=' : cannot convert from 'int' to 'struct HHOOK__ *'
What's really weird is that intellisense shows the function and
parameters when I use the global scope operator like so:
ghHook = ::SetWindowsHookEx(WH_KEYBOARD_LL, &LowLevelKeyboardProc,
(HINSTANCE)hMod, 0);
Unfortunately, in addition to the 2 errors above, this results in the
following additional error:
error C2039: 'SetWindowsHookEx' : is not a member of '`global
namespace''
Any idea what I might be doing wrong?
TIA
Steve
messages and forward them to my compact frame work MessageWindow.
Here's a code snippet from my dll:
VOLUMEHOOK_API bool InitHook(HWND hMsgWnd, HINSTANCE hMod)
{
ghMessageWnd = hMsgWnd;
ghHook = SetWindowsHookEx(WH_KEYBOARD_LL, &LowLevelKeyboardProc,
(HINSTANCE)hMod, 0);
return ghHook != NULL;
}
When I try to compile the project I get the following errors:
error C2065: 'SetWindowsHookEx' : undeclared identifier
error C2440: '=' : cannot convert from 'int' to 'struct HHOOK__ *'
What's really weird is that intellisense shows the function and
parameters when I use the global scope operator like so:
ghHook = ::SetWindowsHookEx(WH_KEYBOARD_LL, &LowLevelKeyboardProc,
(HINSTANCE)hMod, 0);
Unfortunately, in addition to the 2 errors above, this results in the
following additional error:
error C2039: 'SetWindowsHookEx' : is not a member of '`global
namespace''
Any idea what I might be doing wrong?
TIA
Steve