function pointers and dlls
-
hi guys. i am trying to use pointers to functions in my dll to call a function in my .exe i am storing my pointer in a global variable, so it can be called by any function. the trouble is, i am finding that it can be only called by my addeventCallback function i.e. Code: #include "dll.h" EVENTCALLBACK evtcb = NULL; BOOL WINAPI AddEventCallback(EVENTCALLBACK ptr) { evtcb = ptr; evtcb("pass on the message!"); evtcb("pass on the message!"); } LRESULT CALLBACK GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam) { if(nCode < 0) return CallNextHookEx(0, nCode, wParam, lParam); evtcb("pass on the message!"); this displays "pass on the message" twicein the console, but when i try to cal evtcb() from GetMsgProc, it does not show again, meaning it has failed somewhere. i know my GetMsgProc is fine as i have used other indicators such as MessageBepp(0) to show it is working. what is the problem here? cheers. -- modified at 8:50 Thursday 8th September, 2005