Direct Input trouble

Started by
6 comments, last by ITH3 23 years, 3 months ago
Hi, I''m having a little trouble setting up direct input. The code i''m using is: if(FAILED(DirectInputCreate(hInst, DIRECTINPUT_VERSION, &lpdi, NULL))) { return FALSE; } I am including dinput.h and dinput.lib and get the following error: ''DirectInputCreate'' : undeclared identifier. I''m using DX 8.0 . Thanks
Advertisement
I think the function in DX8 is ''DirectInput8Create''. Looks like you forgot the ''8'' between ''Input'' and ''Create''. Also, I think(still not fully sure) that when trying to use an older version of DirectInput, you need to define what version you want. For example #define DIRECTINPUT_VERSION 0x0300 . Hope this helps!

"I kinda think, therefore, I kinda... am?"
Thanks for the reply. A different error comes up now while using DirectInput8Create: ''DirectInput8Create'' : function does not take 4 parameters. What are the parameters for DirectInput8Create? BTW DirectInput8Create doesn''t come up in the MSDN Library. Thanks
Maybe this can help u
Had the exact same problem.

In your link settings, make sure you have "dinput8.lib" NOT "dinput.lib"...

This should fix everything.

Have a blast.

-----------------
The Goblin
-----------------
"Oh, God..."
"Yes?" <- My Response
- The Goblin (madgob@aol.com)
Check on the developer docs you ought to have got with the DirectX 8 SDK, that should tell you all you need to know about parameters. It also has some helpful tutorials (well, helpful in a relative sense...) that could sort out your problem.

I''d give you the info myself, but I''m just fresh off a format and nothing is installed


-Mezz

P.S. If you don''t have the DirectX 8 docs, you can get them online at M$''s website.
If you want to use a version of DirectInput that is not version 8, you do not need to change to version 8. Keep all your existing code, and just add to the top of every file you include dinput.h in the following define (make sure that you do it before you include dinput.h)
#define DIRECTINPUT_VERSION 0x0300
Then DirectInput will work as if you have version 1 of directinput. That is all that you need to do.


Just because you''re outnumbered doesn''t mean you''re wrong.


sharewaregames.20m.com

Thanks for your help guys, got it working.

This topic is closed to new replies.

Advertisement