I'm having trouble setting up a callback function. I have a class ClassA that is instantiating another class ClassB.
ClassB's header has:
typedef void ( CALLBACK* MSGPROC ) ( void*, char*, int );
void SetCallback( MSGPROC pFunction, void* pValue ) { m_pCBFunction = pFunction; m_pCBArg = pValue; }
ClassA's header has:
void (*lpFunc) ( void* p, char* vstrMsg, int vnSrcConnectId );
void CALLBACK MessageReceived( void* p, char* vstrMsg, int vnSrcConnectId );
ClassA's cpp file has:
void CALLBACK ClassA::MessageReceived( void* p, char* vstrMsg, int vnSrcConnectId )
When I try to compile, I get:
error C2440: '=' : cannot convert from 'void (__stdcall CMachMonitor::* )(void *,char *,int)' to 'void (__cdecl *)(void *,char *,int)'
There is no context in which this conversion is possible
Can someone tell me what I'm doing wrong?
ClassB's header has:
typedef void ( CALLBACK* MSGPROC ) ( void*, char*, int );
void SetCallback( MSGPROC pFunction, void* pValue ) { m_pCBFunction = pFunction; m_pCBArg = pValue; }
ClassA's header has:
void (*lpFunc) ( void* p, char* vstrMsg, int vnSrcConnectId );
void CALLBACK MessageReceived( void* p, char* vstrMsg, int vnSrcConnectId );
ClassA's cpp file has:
void CALLBACK ClassA::MessageReceived( void* p, char* vstrMsg, int vnSrcConnectId )
When I try to compile, I get:
error C2440: '=' : cannot convert from 'void (__stdcall CMachMonitor::* )(void *,char *,int)' to 'void (__cdecl *)(void *,char *,int)'
There is no context in which this conversion is possible
Can someone tell me what I'm doing wrong?