Sign in to follow this  
Lionmane

DirectInput error

Recommended Posts

I'm getting an error while trying to create a DirectInput object. This is the code:
int My_Direct_Input (void)
{
     FILE *fp = fopen ("initialize_report.txt", "a");

     if (!(DirectInput8Create (hInstance, DIRECTINPUT_VERSION, IID_IDirectInput8, (void **) &m_pDirectInput, NULL)))
     {
          fprintf (fp, "\n\nDirectInput initialization: FAILED");
          Direct_flag = 0;
     }
     else
     {
          (insert initialization code here)
     }
}

The error I'm getting is: 'DirectInput8Create' undefined; assuming extern returning int and also 'IID_IDirectInput8' undefined; assuming extern returning int I have dinput.h included and I have dinput.lib in my project settings (I'm using MSVC++ ver 6.0). Does anyone know why I'm getting this? mw

Share this post


Link to post
Share on other sites
What SDK version are you using?
VisualStudio 6 is no longer supported by recent versions of DX 9.

Also if my memory doesn`t fail me you should link to 'dxguid.lib' too.

Share this post


Link to post
Share on other sites
I checked this site:
http://support.microsoft.com/gp/lifeobsoleteproducts

But it didn't list MSVC++ ver 6.0 as obsolete yet. Could it be something else? I'm using the latest version of DirectX.

mw

Share this post


Link to post
Share on other sites
Quote:
Original post by Lionmane
I checked this site:
http://support.microsoft.com/gp/lifeobsoleteproducts

But it didn't list MSVC++ ver 6.0 as obsolete yet. Could it be something else? I'm using the latest version of DirectX.

mw

The page you link to is about technical support, from Microsoft. Visual C++ 6.0 is NOT supported by any SDKs since December 2004. The last supporting SDK is the October 2004 SDK with the extras package. This information is mentioned in the Forum FAQ.

Share this post


Link to post
Share on other sites
Ok, now I'm using MSVC++ ver 6.0 with service pack 6.

I'm using DirectX 9.0 (October 2004 release).

I'm still getting errors when attempting to compile... :-(

Here is the code that contains all of the errors:


int My_Direct_Input (void)
{
FILE *fp = fopen ("initialize_report.txt", "a");

if (DirectInput8Create (hInstance, DIRECTINPUT_VERSION, IID_IDirectInput8, (void **) &m_pDirectInput, NULL))
{
fprintf (fp, "\n\nDirectInput initialization: SUCCESS");
Direct_flag = 0;
}
else
{
fprintf (fp, "\n\nDirectInput initialization: FAILED");
Direct_flag = 1;
}
}



The errors I'm getting are:

01) 'function': incompatible types
02) 'DirectInput8Create': different types for formal and actual parameter 3 (this is a warning)

mw

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this