• ### Announcements

#### Archived

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

# Direct Input

## Recommended Posts

DanTheRocker    122
I''ve been making a game with DirectDraw and now need to implement DirectInput. However when I try to include , Borland gives me all kinds of errors IN the dinput.h file itself. I have all the right directories included (on my computer d:\directx sdk\include & d:directx sdk\lib ) and the sdk version is 8.0. The errors are like "name type expected" "declaration missing ;" blah blah. Why is Borland giving me errors in dinput.h?

##### Share on other sites
Alex5    122
if the compiler is giving you errors IN the dinput.h file, it means you don''t have the direcories set up right or you don''t have all the lib files included in the build settings. I am not too familiar with Borland, but vc++ gives me errors IN the dinput.h file when I don''t include the dirctories and lib files right.

##### Share on other sites
Alex5    122
Oh! almost forgot, there are seperate files to include if you are using a Borland compiler, so make sure you are including the right things

##### Share on other sites
You must include the files C_DINPUT.LIB and DINPUT8.LIB

If you don´t have them I can e-mail to you

"- To begin with, said the Cat, a dog''s not mad. You grant that?
- I suppose so, said Alice.
- Well, then, - the Cat went on - you see, a dog growls when it''s angry, and wags its tail when it''s pleased. Now I growl when I''m pleased, and wag my tail when I''m angry. Therefore I''m mad."

##### Share on other sites
DanTheRocker    122
I''ve been studying the error a bit further and found that the compiler doesn''t know what "UINT_PTR" type is. This type is found in the "dinput.h" file. This type occurs 4 times in the dinput.h file. So i suppose if i can find where this "UINT_PTR" type is from i can fix the problem.....do you know where it''s from??

##### Share on other sites
I dont know where its from, however i think i can tell you what it is.

although if you've neglected to include the windows.h file, it should be in there.

anyhoo i think this is what that UINT_PTR is (and if you see some weird stuff its because i forgot the special markup stuff for the forum):

  typedef unsigned int UINT, *UINT_PTR;

Edited by - ElNoNombreHombre on September 22, 2001 5:16:11 PM

##### Share on other sites
atcdevil    145
I have a 3mb zip of borland-compatible directx 8 libraries. If you want them email me. atcdevil@optonline.net

##### Share on other sites
acraig    471
quote:
Original post by DanTheRocker
I''ve been studying the error a bit further and found that the compiler doesn''t know what "UINT_PTR" type is. This type is found in the "dinput.h" file. This type occurs 4 times in the dinput.h file. So i suppose if i can find where this "UINT_PTR" type is from i can fix the problem.....do you know where it''s from??

It''s defined in "basetsd.h". Include that before you include "dinput.h".

-------
Andrew

##### Share on other sites
AndyTX    806
Don''t know if this will help but make sure that in whatever file(s) that you have included DInput.h, it includes VCL.h FIRST, like so:

#include // MUST be before including DInput.h
#include "dinput.h"

If that doesn''t work, just reply and I''ll check what I do, since I actually have it working fine... I don''t remember any problems with it at all actually.

By the way, the Borland Compatible libraries that these guys are talking about are needed (unless you IMPLIB your own, which is easy) however that is not the cause of your problem. They would give you LINKER errors while you are getting COMPILER ones.

Hope that helps some.