Advertisement

Can't initialize DInput

Started by February 24, 2000 08:12 PM
3 comments, last by theRaskell 25 years ago
The DirectInputCreate call is failing on me. The error code returned is unfortunately meaningless to me, but the one thing I did notice is that it doesn''t recognize the DIRECTINPUT_VERSION const I''m passing to it either. What am I missing here? I''ve got the dinput.lib and dxguid.lib included into the project. I have dinput.h included into the cpp file. It makes the call, but doesn''t recognize the const.
Try putting this define before including DInput.h

#define DIRECTINPUT_VERSION 0x0300

then make your call as

DirectInputCreate( GetModuleHandle( NULL ), DIRECTINPUT_VERSION, &this->lpDI, NULL );

This is mostly necessary for NT, I''ve found. Unless you define this, DirectX figures you want to use DInput 5 which doesn''t do so well. Unless, of course, you''re using the latest version of DirectX.
"The object of war is not to die for your country, but to make the other bastard die for his"
Advertisement
You should #define INITGUID as well.
I''m sorry, if you already know
I''m using DirectX 6.1 with Win98. I''ve defined INITGUID and I''ve tried making the call to DirectInputCreate using the actual value of DIRECTINPUT_VERSION, but I still get the same error.
Figured out what I was doing wrong. I was sending DirectInputCreate the handle to the window, not the hinstance of the window. Prolly would have been obvious if I''d had some error other then -21049388594 (made up number there) to go on. Oh well. Endure the pain and trudge onward.

This topic is closed to new replies.

Advertisement