Original Post
I'm trying to wrap direct input in one InputManager class but am having problems setting up callback functions. I want the enumDevicesCallBack and the enumObjectsCallBack to be member functions in the InputManager class but i keep getting compile errors. The error i get is, "error C2664: 'IDirectInput8A::EnumDevices' : cannot convert parameter 2 from 'BOOL (const DIDEVICEINSTANCE *,void *)' to 'LPDIENUMDEVICESCALLBACKA' None of the functions with this name in scope match the target type" I have declared the function in the header as,
hr = m_lpDirectInputInterface->EnumDevices( DI8DEVCLASS_GAMECTRL, enumControllersCB,
NULL,
DIEDFL_ATTACHEDONLY );
BOOL CALLBACK enumControllersCB(const DIDEVICEINSTANCE* pdidInstance, VOID* pContext);
I've tried changing paramater 2 to cInputManager::enumControllersCB, but that doesnt help, same error message. also, doing this C style (ie declaring the function outside of the class as a standalone function) works fine, - why? Maybe this is a C/C++ question rather than DX, sorry if i misplaced it. [Edited by - Coder on October 28, 2005 11:37:11 PM]