Jump to content
  • Advertisement


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


Can't get Direct Input to initialize

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

having some retarded dinput problems. my error code is that one of my parameters are invalid. the code is as simple as this:

DirectInput8Create(hInstance, DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&DInput, NULL)

im assuming that the bogus parameter is (void**)&DInput but i dont know why the only references i have made to the DInput variable is the creation of it:


the dinput.h header included alright too. everything in the code seems to be alright i dont know what the hell is wrong. maybe there are more headers i need to include or something. im using dx8

Share this post

Link to post
Share on other sites
Posting the actual error message tends to be more helpful when solving problems than "my error code is that one of my parameters are invalid"... is it happening at compile time (a compiler error) or run time (a program error):

1. Make sure you are linking with dinput8.lib AND dxguid.lib

2. Make sure the DirectX SDK paths are at the *top* of the search order list in Tools->Options...->Directories

1. The hInstance is about all that could be wrong. Try replacing it with GetModuleHandle(NULL), if it works you''ve passed an invalid HINSTANCE.

2. Install the debug version of the DirectX SDK (plus make sure the runtime version is set to debug), and increase the debug output level for DirectInput in the DirectX control panel.
Debug the program and at your debug output window, the reason for the error *IS* there.

3. So many other possibilities such as bad creation of your window, other exclusive mode DirectInput app running, other instance of your app running, DirectInput on different thread to window creation. Thats why the debug output is so useful for tracking stuff down.

Simon O''''Connor
Creative Asylum Ltd

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!