Direct Input Problem

Started by
4 comments, last by sakky 19 years, 7 months ago
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
Mikehttp://cs.wpunj.edu/~bowersom
Advertisement
- Are you sure the instance is valid?
- Try using GetModuleHandle(0) instead
- Enable debug output and look for interesting messages

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]
Um, that was me...been a while and forgot to log in.
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!
Mikehttp://cs.wpunj.edu/~bowersom
Microsoft made tings this way to confude you. You get frusterated then guy buy more products to better understand them.
Take back the internet with the most awsome browser around, FireFox

This topic is closed to new replies.

Advertisement