Original Post
When setting up directPlay you have to specify the call back function like:
g_pDPClient->Initialize(NULL, DirectPlayMessageHandler, 0 )
Where DirectPlayMessageHandler is a function usually defined like:
HRESULT WINAPI DirectPlayMessageHandler(PVOID pvUserContext, DWORD dwMessageId, PVOID pMsgBuffer)
But, what if you wanted DirectPlayMessageHandler to be a class function defined in a class called Multiplayer? I tried doing this and got an error message as follows:
error C2664: ''Initialize'' : cannot convert parameter 2 from ''long (void *,unsigned long,void *)'' to ''long (__stdcall *const )(void *,unsigned long,void *)''
Any ideas on what I''m doing wrong? I tried making DirectPlayMessageHandler a static method. That got rid of this particular error but introduced others due to the fact that it is now static. Am I on the right track? What should I do?