Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DirectInput Callbacks

Status
Not open for further replies.

Rob3

Programmer
Nov 21, 2002
1
NZ
Hi all,

I am having problems with C++'s use of member function pointers and the DirectInput callbacks.

I have a class with the function i want to use:

class CInput {
public:
BOOL CALLBACK EnumDevicesSemanticsCallback(LPCDIDEVICEINSTANCE,LPDIRECTINPUTDEVICE8,DWORD,DWORD,LPVOID);
}

and in one of my functions, I need to tell Dinput to use this function for callback.

BOOL (CALLBACK CNemInput::*Call)(LPCDIDEVICEINSTANCE,LPDIRECTINPUTDEVICE8,DWORD,DWORD,LPVOID);

Call = &CInput::EnumDevicesSemanticsCallback;

hr = lpdi->EnumDevicesBySemantics(NULL, &m_ActionMap,Call,this, 0L);

However, I get this error message:

error C2664: 'IDirectInput8A::EnumDevicesBySemantics' : cannot convert parameter 3 from 'BOOL (__stdcall CInput::* )(LPCDIDEVICEINSTANCE,LPDIRECTINPUTDEVICE8,DWORD,DWORD,LPVOID)' to 'LPDIENUMDEVICESBYSEMANTICSCBA'


Any Ideas?

Thanks

btw, using visual studio .net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top