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
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