#### Archived

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

# Can't get Direct Input to initialize

This topic is 5991 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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:
  LPDIRECTINPUT8 DInput = NULL; 
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 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):

COMPILE TIME:
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

RUN TIME:
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
www.creative-asylum.com

##### Share on other sites
GO checkout the Dinput tut''s I have on my site at www.infantrydb.com/kingsrevenge Bunnies from NeXe shold have put them up on his site but he has been like not avaiblae for the lognest amoutn of time.

Eric Wright o0Programmer0o

AcidRain Productions