Jump to content
  • Advertisement
Sign in to follow this  
dotminic

DirectInput8Create fails : E_INVALIDARG

This topic is 2665 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 using DirectInput with Direct3D 11, and compiling for x64 and I get an E_INVALIDARG from this line:


HRESULT hr = DirectInput8Create(hInstance, DIRECTINPUT_VERSION, IID_IDirectInput8, reinterpret_cast<void **>(&this->_d8Input), 0);


When I set a break point to look at what is going on I get no sign of any invalid arguments. My hInstance is valid, so is the _d8Input pointer and the DIRECTINPUT_VERSION is set to 0x0800.

I've used direct input with D3D9 before, in the exact same way and didn't have any problems.
What am I missing ?

Thanks.

Share this post


Link to post
Share on other sites
Advertisement
I am using DX11.
It turns out I was compiling with /SUBSYSTEM:CONSOLE and the hInstance passed in from WinMain when using a console subsystem doesn't please DirectInput8Create at all.

Share this post


Link to post
Share on other sites
ok, try this DirectInputCreateEx(), and check this thread http://msdn.microsoft.com/en-us/library/microsoft.directx_sdk.reference.directinput8create%28v=vs.85%29.aspx

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!