Offhand, I don't see anything wrong with this code. Did you write, or do you have, the
source code for the DLL? If so, you could single-step through it and make sure that there
actually is an execution bath that really does call the callback. If you don't execute
that path of code, it would suggest that the problem is other than in the callback logic.
its a regualr mfc dll.
and what i mean by non mfc dll (calling dll) is its a win32 dll
I can not really post the code here
but it looks something like this:
and the prob is CallBackSendHello and setstat doesnt seem to get called
although it works when i write the sametning in an MFC app.
class x
{
public: a() (and other member function and varriable in it)
}
// not member of x
void callbackstatus(code);
void callbackSendHello(void*, void*);
..... so on
bool a(x, y, z....)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
x = InitConnection(x, y z);
// Set up the call back for Status
GetConnStatFunction( setstat);
OpenConn();
ret = SendHello(CallBackSendHello, x1, y1, z1);
if (ret != OK)
{
return false;
}
return true;
}
void setstat(ConnStatus code)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
switch (code)
{
case 1:...
case 2: ....
}
}
void CallBackSendHello(void *code, void *code2)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
.....do somehting
}
thanks
S
-----------
Ajay Kalra wrote:
i am having problem invoking an mfc callback function from a non mfc
dll.
What callback function? What MFC DLL is it? Regular or Extension? What
do you mean by a non MFC DLL? Is it a VB or Win32 or an .Net assembly?
---
Ajay
Joseph M. Newcomer [MVP]