Jump to content
  • Advertisement


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


DirectInput problem

This topic is 5935 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

Hi all, I have a problem when I want to set the cooperative level the joystick. No matter what I do, I get an E_HANDLE error back. Here''s how I call the function: if(FAILED(hres = pdev->SetCooperativeLevel(hWndMain, DISCL_EXCLUSIVE | DISCL_FOREGROUND))) { } pdev is an LPDIRECTINPUTDEVICE8, created before with a call to CreateDevice() hWndMain.unused = 0. The strange thing is, it worked just fine with DInput7. Anyone can help? When I load up the Joystick example from the SDK, the call to SetCooperativeLevel() works fine there, yet I can''t get it to work in my own application.

Share this post

Link to post
Share on other sites
Its always a good habit to use


as I find that it usually works more often than not.

Also, From past experience I have found that the SetCooperativeLevel function (when using MFC) has to be created after the initial message loop has been performed. I.e. I had problems initialising Input devices in the OnCreate(.. handler and had to call it at a later time for it to work.

Dont know if that helps

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!