C Board  

Go Back   C Board > General Programming Boards > Game Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 06-12-2005, 11:01 AM   #1
Deo
Registered User
 
Join Date: May 2005
Posts: 73
Thumbs down Require immediate aid and assist. Close to commiting homicide.

Is direct input a thing of mystery? Cause right now its giving me an ulcer.

I had Visual C++ 6.0 and I got a debugging corrupt error. Microsoft site said as of December 2004 SDK Visual C++ 6.0 no longer supported. Someone told me download EXTRAS would fix my problem. So i downloaded 65MB December EXTRAS.. nope didn't work.. downloaded October EXTRAS 23 MB nope nothing...

OK burn Visual C++ 6.0 as someone else noted and get free Microsoft 2003 toolkit compiler..

Done...

Get opensource IDE...

Done... (Code::Blocks)

My directx program compiles and runs fine. But when I uncomment my direct input code i get..:

Code:
syntax error:  missing ';' before identifier 'g_InputObject
'LPDIRECTINPUT8': missing storage class or type specifiers
'g_InputObject': missing storage class or type specifiers
I have included
<dinput.h>
linked with
dinput8.lib

Code:
LPDIRECTINPUT8 g_InputObject = NULL;
WTF?! why!

Only thing I can think of is downloading the Windows SDK crap. (Please say the answer is no.. my 56k modem is dying and all this downloading of toolkits, ides it killing me)
Currently just using the lib and include folder that came with Visual C++ 6.0 so I can compile and execute WIN32 apps...

And please hurry.. I'm starting to hear voices in my head..
Deo is offline   Reply With Quote
Old 06-12-2005, 01:16 PM   #2
Registered User
 
Join Date: Apr 2002
Posts: 1,571
Do you have the include directories pointing to where you installed the DX SDK?
__________________
"...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers
MrWizard is offline   Reply With Quote
Old 06-12-2005, 01:44 PM   #3
Deo
Registered User
 
Join Date: May 2005
Posts: 73
yep, I have a directx program rendering an animated sprite as well as a background image being displayed... so I have all my directories setup correctly.. Just when I add the above that error is what happens...
Deo is offline   Reply With Quote
Old 06-12-2005, 02:03 PM   #4
Registered User
 
Join Date: Apr 2002
Posts: 1,571
You want to zip up your project and I'll take a look at it? But really all you need is:

Code:
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
#pragma comment(lib, "dxguid.lib")
#pragma comment(lib, "dinput8.lib")

IDirectInput8 *pInput = NULL;
HRESULT hr = DirectInput8Create(GetModuleHandle(NULL), DIRECTINPUT_VERSION, IID_IDirectInput8, reinterpret_cast<void**>(&pInput), NULL);
That compiles / links fine for me using VC++ .NET 2k3
__________________
"...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers
MrWizard is offline   Reply With Quote
Old 06-12-2005, 02:57 PM   #5
Deo
Registered User
 
Join Date: May 2005
Posts: 73
owww... my head hurts....

I looked at your reply and said to myself.. I've tried that a million times over the last 3 days.. and the errors always popped up the same.....

I had been linking my libraries through the setup rather than #pragma
So i decided to delete all the libraries I linked and used your #pragma...
It worked.. so i figured it was the way I was linking with this new IDE.. but I commented out the #pragmas and relinked through settings and it worked again! what the?
I dunno.. maybe I forgot a .lib the first go around.. though I really doubt it as I doubled and triple checked.. guess all this switching between IDEs got me confused or something..

Working now under open source IDE ( still hates VC++ 6.0 but I'm happy with that)

Thnx for the assistance.. I guess your karma did something...
(lol so much headache over such a little thing and gonna use #pragma for libraries from now on.. much easier)

Only thing else i changed was from
Code:
 hInstance
->
Code:
GetModuleHandle(NULL)
though that wasn't the source of my woes..

Last edited by Deo; 06-12-2005 at 03:01 PM.
Deo is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump


All times are GMT -6. The time now is 12:39 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22