Sign in to follow this  
  • entries
    234
  • comments
    427
  • views
    114418

Problems with DirectInput

Sign in to follow this  
Battagline

90 views

I'm having a problem with DirectInput trying to enumerate the axes.



BOOL CALLBACK EnumAxesCallback( const DIDEVICEOBJECTINSTANCE* pdidoi,
VOID* pContext );



if ( FAILED( hr = m_pJoyDev->EnumObjects( EnumAxesCallback,
(VOID*)g_hWndMain, DIDFT_AXIS ) ) )
return hr;




Then I get the following compiler error.

error C2664: 'IDirectInputDevice8A::EnumObjects' : cannot convert parameter 1 from 'BOOL (const DIDEVICEOBJECTINSTANCE *,void *)' to 'LPDIENUMDEVICEOBJECTSCALLBACKA'
None of the functions with this name in scope match the target type

I'm not sure what's going on. I took this code straight out of the DirectX samples. The sample compiles, but when I copy the code into my engine, no luck.

I started a thread on Game Dev, Indie Gamer, and IGDA to investigate.
Sign in to follow this  


2 Comments


Recommended Comments

Just cast the first parameter of IDirectInput8::EnumDevices to DIENUMDEVICEOBJECTSCALLBACK?


BOOL CALLBACK EnumAxesCallback( const DIDEVICEOBJECTINSTANCE* pdidoi,
VOID* pContext );



if ( FAILED( hr = m_pJoyDev->EnumObjects( (DIENUMDEVICEOBJECTSCALLBACK)EnumAxesCallback,
(VOID*)g_hWndMain, DIDFT_AXIS ) ) )
return hr;





I don't have access to DirectX SDK at the moment, but I'm quite sure that should do the job...

Share this comment


Link to comment
Argh, posted reply and accidently deleted it [lol]

Anyways, casting the first parameter that compiler complains about to DIENUMDEVICEOBJECTSCALLBACK should do the job.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now