Original Post
Hey Guys,
because I have solved a problem with your help earlier, I post my "new" problem to this great forum, hoping sb. had the same too.
I aquired a Keyboard with DInput without problems. Now I want to enumerate and aquire a joystick. But I always get an error message calling callback-functions from inside a class-function.
My code is (only the important):
//--------------------------------------------------------------
BOOL CALLBACK CMyD3DApplication::DIEnumDevicesCallback(const DIDEVICEINSTANCE* pdidInstance, VOID* pContext)
{
HRESULT hr;
// Obtain an interface to the enumerated joystick.
hr = g_pDI->CreateDevice(pdidInstance->guidInstance,
&g_pJoystick, NULL);
if(FAILED(hr))
return DIENUM_CONTINUE;
return DIENUM_STOP;
}
HRESULT CMyD3DApplication::OnCreateDevice( HWND hWnd )
{
HRESULT hr;
[...]
if( FAILED( hr = DirectInput8Create( GetModuleHandle(NULL), DIRECTINPUT_VERSION,
IID_IDirectInput8, (VOID**)&g_pDI, NULL ) ) )
return hr;
if( FAILED( hr = g_pDI->EnumDevices( DI8DEVCLASS_GAMECTRL,
DIEnumDevicesCallback,
NULL, DIEDFL_ATTACHEDONLY ) ) )
return hr;
[...]
}
//--------------------------------------------------------------
Now I get the following error message from my VC++ 6.0 compiler:
cannot convert parameter 2 from ''int (const struct DIDEVICEINSTANCEA *,void *)'' to ''int (__stdcall *)(const struct DIDEVICEINSTANCEA *,void *)''
Hope anyone knows an answer, because I have to use the enumeration call inside the class function. I don''t know much about callback functions at all (didn''t need them up to now) and I also don''t know what the compiler means with __stdcall-pointer ??!! Please Help!
Thanks you a lot again,
Greetings, Andy