Jump to content
  • Advertisement

Archived

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

tstrimp

DirectInput8Create

This topic is 5771 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

When trying to create the device context I get an error I believe it''s somthing like Invalid Token IID_IDirectInput8A and then the unresolved external after that. Any idea what I might be doing wrong? I know I''m not providing much information but my internet at home is down so I can''t post there and I forgot to writte down the exact error. Also I was wondering if it were possible to use direct input in a console app, for use with glut for example. Thanks! Tim

Share this post


Link to post
Share on other sites
Advertisement
1) read instructions in whatever book/tutorial/help file you were using to get started with directinput.

2) yes.

Share this post


Link to post
Share on other sites
1. I did, from what I can tell my code is pretty much exactly the same.

2. Great, now could someone point me to some resources about doing such?

My aren''t we helpful...

Share this post


Link to post
Share on other sites
great, look for instructions on project settings, in particular linker options.

the only difference between a console and a windowed application is that former gets a console by default and latter doesn''t. you can, nonetheless, create a console for a windowed app and create windows for a console app, and in general, everything a console app does can be done in the windowed app and vice versa.

so dinput code is the same no matter what your project type is.

now if dinput wants a window handle, you''ll need to create a window, possibly using glut, and provide di with the handle to it.

Share this post


Link to post
Share on other sites
The IDD_IDirectInput8Create interface is defined in and linked using the dinput.lib library. Make sure that your source has these files included in it. If you do not have the DirectX SDK installed or the Directories/Project setting mapped properly you will get the error.

The not defined error comes from not including the header file in the source BEFORE the usage of the function. The unresolved external comes from the library for Direct Input not being linked to your application properly or the compiler's inability to locate the library during compile time.

Kressilac

ps Also check and see if you CoInitialize COM before the Direct Input calls and CoUninitialize it after you're through using Direct Input.

[edited by - kressilac on December 4, 2002 2:12:42 PM]

Share this post


Link to post
Share on other sites
Thanks kressilac I''ll try that later! I am pretty sure I didn NOT have the lib included just the header file.

Share this post


Link to post
Share on other sites
ok, my internet is back up. Here are the exact error messages.

1.) errorLNK2020: unresolved token (0A000026) IID_IDirectInput8A
2.) fatal error lnk1120: 1 unresolved externals

I have included dinput.h and windows.h

At first I thought the problem was because I wasn't using WinMain because I was using glut but when I changed that I got the same error. Am I supposed to #include <dinput.lib>? I have tried that but it couldn't find it and I know I have the SDK installed. Any help please?

[edited by - tstrimp on December 4, 2002 7:27:21 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!