Original Post
Hi! I am trying to create a directPlay class but am having problems with the WINAPI messagehandler function. I guess I am not the first to do this so maybe someone outthere can help me? In "procedural" code I have this: HRESULT WINAPI DirectPlayMessageHandler(PVOID pvUserContext, DWORD dwMessageId, PVOID pMsgBuffer); HRESULT WINAPI DirectPlayMessageHandler(PVOID pvUserContext, DWORD dwMessageId, PVOID pMsgBuffer) { switch(dwMessageId) case ... ... } pDP->Initialize(NULL, DirectPlayMessageHandler, 0) And in "class" code I want the exact same thing but with cDPlay:: HRESULT WINAPI DirectPlayMessageHandler(PVOID pvUserContext, DWORD dwMessageId, PVOID pMsgBuffer); HRESULT WINAPI cDPlay::DirectPlayMessageHandler( PVOID pvUserContext, DWORD dwMessageId, PVOID pMsgBuffer ) { switch(dwMessageId) case ... ... } pDP->Initialize(NULL, DirectPlayMessageHandler, 0) But this generates cannot convert type1/type2 errors. So how it is done? Please Help!