DirectInput8Create fails : E_INVALIDARG

Started by
2 comments, last by hannody 13 years, 1 month ago
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.
Advertisement
Mate, I think because ur using DX8 where on X64, u can use DX11 instead.

cheers.
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.
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

This topic is closed to new replies.

Advertisement