Jump to content
  • Advertisement
Sign in to follow this  
bower12345

Direct Input Problem

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

Hey folks, When trying to initialize Direct Input, I get an error which translates into an invalid parameter being passed. I'm trying to initialize DirectInput 7 and I current have DirectX 9.0b installed on my test machine so I don't believe there should be any problems. This is the code I'm using:
HRESULT hResult = DirectInputCreateEx( WindowInstance, DIRECTINPUT_VERSION, IID_IDirectInput7, ( void ** )&lpdi, NULL );

WindowInstance is a global application instance handle. DIRECTINPUT_VERSION is defined in theheader file as 0x700. Please advise. Thanks, Mike

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Quote:
- Are you sure the instance is valid?
- Try using GetModuleHandle(0) instead
- Enable debug output and look for interesting messages


That's what happened to me just recently. I just made a custom windows message that sent to my window after i was sure that my instance was valid and initialized DirectInput (actually, winsock and D3D too) then. Worked fine after that.

[Edited by - Coder on September 22, 2004 5:19:18 PM]

Share this post


Link to post
Share on other sites
Well,

Using GetModuleHandle( NULL ) works fine although I'm confused as to why this instance would not be valid. But everything seems to work fine now. Thanks very much!

Share this post


Link to post
Share on other sites
Microsoft made tings this way to confude you. You get frusterated then guy buy more products to better understand them.

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!