Thread: Require immediate aid and assist. Close to commiting homicide.

  1. #1
    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..

  2. #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

  3. #3
    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...

  4. #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

  5. #5
    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.

Popular pages Recent additions subscribe to a feed