Skip to main content
GameDev.net gamedev.net
🔒 Locked

Direct Input trouble

Started by ITH3 Jan 12, 2001 at 7:55 PM 6 replies 800+ views
Original Post
ITH3
ITH3
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
Psychocatt
Psychocatt
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?"
ITH3
ITH3
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
Janju
Janju
Maybe this can help u
Goblin
Goblin
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)
Mezz
Mezz
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.
furby100
furby100
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

ITH3
ITH3
Thanks for your help guys, got it working.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.