I've been trying to load a function from a dll, what I did was this:
And the definition in the .dll looked like this :
typedef LRESULT (CALLBACK *pfKeyProc)(int code, WPARAM wParam, LPARAM lParam);
HINSTANCE dll = LoadLibrary(someLib.dll);
pfKey = (pfKeyProc)GetProcAddress((HMODULE)(dll), "KeyboardProc");
It didn't load correctly, but if I removed CALLBACK from the definition in the .dll it did. Should I define my typedef in some other way or could I just omit 'CALLBACK' from the defintion ?
extern "C" __declspec(dllexport) LRESULT CALLBACK KeyboardProc(int code, WPARAM wParam, LPARAM lParam);
(Or am I doing it all wrong ?)