Jump to content
  • Advertisement
Sign in to follow this  
mageofdreams

Error With Creating DirectInput Object

This topic is 3431 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, I'm trying to use DirectInput for keyboard control in an assignment I'm working on, but I can't get past creating the DirectInput object. Here is what I have for that: HRESULT hr; // create an LPDIRECTINPUT8 object to hold the DirectInput object LPDIRECTINPUT8 InputObject; // create the DirectInput object hr = DirectInput8Create(hInst, DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&InputObject, NULL); // return false if creating the DI object fails if FAILED( hr ) return false; I get no compiler error, but the program exits as soon as it starts running because it evidently must have failed. I've looked over the code and tried to solve this for hours but I am not getting anywhere. Can anyone tell me what I'm doing wrong? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Check the meaning of the HRESULT value returned, what is it? There doesnt seem to be anything wrong with the way you are creating it, are you sure this is where/why its exiting? Have you ran it through the debugger?

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!