Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

LOWORBIT

DirectInput 8 JOYSTICK init problem

This topic is 6066 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m have a problem when creating a callback function, e:\alpha\inputdi8.cpp(391) : error C2664: ''EnumDevices'' : cannot convert parameter 2 from ''int (struct DIDEVICEINSTANCEA *,void *)'' to ''int (__stdcall *)(const struct DIDEVICEINSTANCEA *,void *)'' this is what vc++ 6.0 returns, and help would be useful, thanks.

Share this post


Link to post
Share on other sites
Advertisement
I use VC++6 this works

BOOL CALLBACK EnumJoysticksCallback(const DIDEVICEINSTANCE*
pdidInstance, VOID* pContext)
{
HRESULT hr;

// Obtain an interface to the enumerated joystick.
hr = G.lpDI2->CreateDevice(pdidInstance->guidInstance,
&G.lpDIJoystick, NULL);
if(FAILED(hr))
return DIENUM_CONTINUE;

return DIENUM_STOP;
}

hope this helps,, if not ...

->Compiler Error C2664
''function'' : cannot convert parameter number from ''type1'' to ''type2''

The specified parameter of the specified function could not be converted to the required type. If you’ve encountered this error on code which compiled with an earlier version of Visual C++, please read Technote: Improved Conformance to ANSI C++ for more information.

The following is an example of this error:

class A {} a;
func( int, A );
void main()
{
func( 1, 1 ); // error, no conversion from int to A
}

Tips

Recheck the prototype for the given function and correct the argument noted in the error message. If necessary, an explicit conversion may need to be supplied.

The twisted mountian man

NIFTY

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!