M
Mohamed Fysal
I have written a Regular DLL with many Export Functions and one CALLBACK fun
ction .
The callback function declared in the .cpp file of the Regular DLL is as fol
lows:
typedef BOOL (CALLBACK* ExProcessMessage)(UINT msg, LPVOID lpParam);
//
ExProcessMessage MyProcMsg;
----------------------------------------------------------------------------
--------------------
I have written an MFC Application which is dynamically linked to this Regula
r DLL.
In the MFC Application (SDI Application with DOC/VIEW support) , I also use
threading functionalities.
In the MFC Application I have declared a global function as a CALLBACK funct
ion as follows:
BOOL CALLBACK OnCMFMessage(UINT msg, LPVOID lpParam1);
I initilaise the address of this function to the pointer varaible declared i
n DLL (MyProcMsg) as follows in my MFC App code:
InitializeCB((long)&OnCMFMessage); -- (whereas the InitializeCB is a export
function in DLL to initialise the callback function pointer)
----------------------------
Now the problem is , when I call the CALLBACK function (OnCMFMessage) from m
y DLL by using the function pointer , the callbcak function is not at all ca
lled. What could be the reason?????
But when I use the as said above with a Win32 application, it worked fine. M
y callbcak is called. And I got the desired result.
The problem was only with the MFC App which I said above.
ction .
The callback function declared in the .cpp file of the Regular DLL is as fol
lows:
typedef BOOL (CALLBACK* ExProcessMessage)(UINT msg, LPVOID lpParam);
//
ExProcessMessage MyProcMsg;
----------------------------------------------------------------------------
--------------------
I have written an MFC Application which is dynamically linked to this Regula
r DLL.
In the MFC Application (SDI Application with DOC/VIEW support) , I also use
threading functionalities.
In the MFC Application I have declared a global function as a CALLBACK funct
ion as follows:
BOOL CALLBACK OnCMFMessage(UINT msg, LPVOID lpParam1);
I initilaise the address of this function to the pointer varaible declared i
n DLL (MyProcMsg) as follows in my MFC App code:
InitializeCB((long)&OnCMFMessage); -- (whereas the InitializeCB is a export
function in DLL to initialise the callback function pointer)
----------------------------
Now the problem is , when I call the CALLBACK function (OnCMFMessage) from m
y DLL by using the function pointer , the callbcak function is not at all ca
lled. What could be the reason?????
But when I use the as said above with a Win32 application, it worked fine. M
y callbcak is called. And I got the desired result.
The problem was only with the MFC App which I said above.