Jump to content
  • Advertisement
Sign in to follow this  

Problem in reading Joystick in DirectX9.0

This topic is 2808 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 am using DirectInputDeviceMtthod to read joystick in coding,but program is not able to read joystick.
1. showing failure of two function:
if (FAILED(hr = joystick->GetDeviceState(sizeof(DIJOYSTATE2), js))) {
return hr; // The device should have been acquired during the Poll()
2. if( FAILED( UpdateInputState( hDlg ) ) )
KillTimer( hDlg, 0 );
MessageBox( NULL, TEXT( "Error Reading Input State. " ) TEXT( "The sample will now exit." ), TEXT( "DirectInput Sample" ),
EndDialog( hDlg, TRUE );

This joystick code is in a program which i am using as a server.I am commun icating this server program to a client programt hrough loopback address( on a single computer.then error is there as mentioned above.i am trying to reading joystick at server side and sending to client.

if i am running both server and client program on two different computer then joystick is working.
what may be the reason.
I tried by setting joystick properties in this function
if (FAILED(hr = joystick->SetCooperativeLevel(NULL, DISCL_EXCLUSIVE |
return hr;


but no success!
Thnx in Advance!

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • 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!