*sigh*
Okay, to use EnumDevices you must have a Callback function, right? So here it is, along with the EnumDevices call:
BOOL CALLBACK DIJoystick::TheCallback(LPCDIDEVICEINSTANCE lpDIDE, LPVOID guidPtr)
{
mJoyGUID = lpDIDE->guidInstance;
strcpy(mJoyName, (char *)lpDIDE->tszProductName);
return(DIENUM_STOP);
}
int DIJoystick::ScanForDevices(LPDIRECTINPUT7 lpDI)
{
if(lpDI->EnumDevices(DIDEVTYPE_JOYSTICK, TheCallback, &mJoyGUID,
DIEDFL_ATTACHEDONLY) != DI_OK)
return(0);
return(1);
}
Compiling this, I get the following error:
C:\Projects\spritemover\input.cpp(403) : error C2664: 'EnumDevices' : cannot convert parameter 2 from
'int (const struct DIDEVICEINSTANCEA *,void *)' to
'int (__stdcall *)(const struct DIDEVICEINSTANCEA *,void *)'
None of the functions with this name in scope match the target type
I've tried "DIJoystick::TheCallback", "this->TheCallback", and a whole host of other things; but it still insists that the callback function is out of scope (I'm guessing, based on the error there)...
Help? Please?
Thanks!
--HB
Edited by - HBringer on 11/28/00 3:57:26 PM