Archived

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

Direct Input: What the hell is going on here!?

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

OK, first of all, I am shocked by the lack of good tutorials on DIn, does anyone know of any tutorials that are BETTER than the SDK? Now my question, I am using BCB 3, and the DX7a SDK, with of course, the Borland Libarys (dinput.lib). Now, I keep getting this:
[LinkerError] Unresolved external ''_IID_IDirectInput7A'' referenced from D:\***\INPUT.OBJ.
[LinkerError] Unresolved external ''_IID_IDirectInputDevice7A'' referenced from *:\***\INPUT.OBJ.
 
I have included the libary properly, and it has only stopped working since I moved from IDirectInput to IDirectInput7 objects (and same for the devices). (note: this is because using the other stuff was stuffing up even more) Any help?
ANDREW RUSSELL STUDIOS
Visit Tiberia: it''s bigger, it''s badder, it''s pouyer...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Did you link "dxguid.lib" ?
I used to have the same problems like you. This solved them.

Mathias

Share this post


Link to post
Share on other sites
Mate.

I feel your pain, getting my Borland v4.52 and DX8 to be buddies was a real mission, and it was DI that was the final straw in fact, for me. I turned to the dark side in the end, MSVC ... but this doesn''t help you

The anon dude is right though. Another way to beat the problem is to throw in a

  

#define INITGUID



up the top. Good luck

El Duderino

Share this post


Link to post
Share on other sites
Argg, I about plunged a sharp object through my chest with this one. How I solved it was to use older directx version 3 libraries just for direct input. However, this caused some other problems I had to work around, but at least it worked. Obviously whomever compiled the borland libs didn''t test direct input to see if they worked before they released the sdk. I talked to a bunch of people at DX support to see if they were going to fix this problem. Their reply was, "don''t use borland." -- Thanks a lot smart a$$. Anyway, needless to say, I moved to MSVC, but there are still times I move back to borland builder to make quick apps. It has been awhile since I have actually used borland and I don''t know if they have resolved these problems with DX8SDK because I still use DX7SDK for the most part.

Share this post


Link to post
Share on other sites
OK guys, thanks alot for that. All fixed.
You don''t know of of any alternitaves to DIn, do you?

*wishes there was an OpenIL or somthing*




quote:
Original post by PowerBoyAlfa
Their reply was, "don''t use borland." -- Thanks a lot smart a$$.


Damnit, when will MS learn that there is software that they DON''T make, and people use it!

It''s moments like these you need LINUX!


ANDREW RUSSELL STUDIOS
Visit Tiberia: it''s bigger, it''s badder, it''s pouyer...

Share this post


Link to post
Share on other sites
quote:
Crap: I am still getting invalid parm errors when I try to create the DIn object (I was getting them before as well). The SDK is very sketchy on how to fix the thing when you get errors. Any help?


Well that all depends on what you''re init code looks like really doesn''t it!
sounds like that could be the way you''re trying to set it up.

"Bad Day... F**K it!" -Stephen Baldwin (Usual Suspects)

Share this post


Link to post
Share on other sites
Wooah, sorry, I was in a hurry to get that one in there, so I forgot the details.


hr = DirectInputCreateEx( hInstance, DIRECTINPUT_VERSION, IID_IDirectInput7, (void**)&m_pDI, NULL );


and hr gets set to DIERR_INVALIDPARAM, and then the setup function returns an error.

I have no idea why this wouldn''t work, it is basicly copy/pasted from the SDK. Could it be somthing to do with the fact that I use clases for everything, and my only global is the function WinMain?

btw, sure none of you know of any good tutorials about the inner workings on direct input?


ANDREW RUSSELL STUDIOS
Visit Tiberia: it''s bigger, it''s badder, it''s pouyer...

Share this post


Link to post
Share on other sites
quote:
Andrew Russell
hr = DirectInputCreateEx( hInstance, DIRECTINPUT_VERSION, IID_IDirectInput7, (void**)&m_pDI, NULL );


Hmmm... well, I assume you're linking with the DX7 libraries else the DIRECTINPUT_VERSION will be wrong.
and that you're setting hInstance to your apps instance.
I'm not sure wether you need to cast m_pDI to (void**),

As for tutorials a quick search of the gamedev archives reveals

http://www.gamedev.net/reference/articles/article1309.asp

hope that helps...



"Bad Day... F**K it!" -Stephen Baldwin (Usual Suspects)

Edited by - Nutter2000 on March 22, 2001 5:02:12 AM

Share this post


Link to post
Share on other sites
Looks good to me ... maybe jam this up top as well

  
#define DIRECTINPUT_VERSION 0x700


... this is the code I''m using atm

  
LPDIRECTINPUT7 lpDI;
.
.
.
if(FAILED(DirectInputCreateEx(hInstance, DIRECTINPUT_VERSION, IID_IDirectInput7, (void **) &lpDI, NULL)))
{
return FALSE;
}


hope it helps.

El Duderino

Share this post


Link to post
Share on other sites
I have recently coded a class for my game that takes care of any keyboard input, it works very fast but it only supports the keyboard, you could have it, Email me at

stefan@nightmarestudios.cjb.net

It is very easy to use ...

Share this post


Link to post
Share on other sites
I''ll toot my own horn here

Check out the "OOP 2: Inheritance and Polymorphism" article at gamedeveloper.net

You can get the code there DIWRAPPERS or at glVelocity. The Direct Input stuff is all encapsulated into classes and works well. I am about to release a Force-Feedback version of the code for DX8 soon.

Regards,
Jumpster

Share this post


Link to post
Share on other sites