durban
09-07-2005, 05:43 PM
I'm using the August update of the SDK which I have included dinput.h and dinput.lib correctly and the header file is intact. BUT when I try to call anything from versions 0x0800(version 8) or actually 0x0700 and above it doesn't get compiled. Here's a snippet of what I have added so far and fails miserably:
#include dinput.h -- removed carrots, html removes the whole thing
DirectInput8Create( g_Window.GetHInstance(), DIRECTINPUT_VERSION, IID_IDirectInput8,
*(void**)&_dinput, NULL);
and the errors:
c:\documents and settings\directx\cgraphics.h(25) : error C2146: syntax error : missing ';' before identifier '_dinput'
c:\documents and settings\directx\cgraphics.h(25) : error C2501: 'LPDIRECTINPUT8' : missing storage-class or type specifiers
c:\documents and settings\directx\cgraphics.h(25) : error C2501: '_dinput' : missing storage-class or type specifiers
c:\documents and settings\directx\cgraphics.h(26) : error C2146: syntax error : missing ';' before identifier '_dinputdevice'
c:\documents and settings\directx\cgraphics.h(26) : error C2501: 'LPDIRECTINPUTDEVICE8' : missing storage-class or type specifiers
c:\documents and settings\directx\cgraphics.h(26) : error C2501: '_dinputdevice' : missing storage-class or type specifiers
c:\documents and settings\directx\cgraphics.cpp(115) : error C2065: 'DirectInput8Create' : undeclared identifier
c:\documents and settings\directx\cgraphics.cpp(115) : error C2065: 'IID_IDirectInput8' : undeclared identifier
c:\documents and settings\directx\cgraphics.cpp(116) : error C2065: '_dinput' : undeclared identifier
It simply doesn't exist to the compiler, and after looking at the header file I noticed that DIRECTINPUT_VERSION is 0x0800 by DEFAULT! For some reason the compiler isn't processing it?
#define DIRECTINPUT_HEADER_VERSION *0x0800
#ifndef DIRECTINPUT_VERSION
#define DIRECTINPUT_VERSION DIRECTINPUT_HEADER_VERSION
#endif
further down....
#if DIRECTINPUT_VERSION > 0x0700
extern HRESULT WINAPI DirectInput8Create(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID *ppvOut, LPUNKNOWN punkOuter);
#else
extern HRESULT WINAPI DirectInputCreateA(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTA *ppDI, LPUNKNOWN punkOuter);
extern HRESULT WINAPI DirectInputCreateW(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTW *ppDI, LPUNKNOWN punkOuter);
My question is why do I have access to DirectInputCreateA() but not DirectInput8Create() when I have even specifically defined a version of 0x0800...I'm using VC++ but it has to be the compiler =\
#include dinput.h -- removed carrots, html removes the whole thing
DirectInput8Create( g_Window.GetHInstance(), DIRECTINPUT_VERSION, IID_IDirectInput8,
*(void**)&_dinput, NULL);
and the errors:
c:\documents and settings\directx\cgraphics.h(25) : error C2146: syntax error : missing ';' before identifier '_dinput'
c:\documents and settings\directx\cgraphics.h(25) : error C2501: 'LPDIRECTINPUT8' : missing storage-class or type specifiers
c:\documents and settings\directx\cgraphics.h(25) : error C2501: '_dinput' : missing storage-class or type specifiers
c:\documents and settings\directx\cgraphics.h(26) : error C2146: syntax error : missing ';' before identifier '_dinputdevice'
c:\documents and settings\directx\cgraphics.h(26) : error C2501: 'LPDIRECTINPUTDEVICE8' : missing storage-class or type specifiers
c:\documents and settings\directx\cgraphics.h(26) : error C2501: '_dinputdevice' : missing storage-class or type specifiers
c:\documents and settings\directx\cgraphics.cpp(115) : error C2065: 'DirectInput8Create' : undeclared identifier
c:\documents and settings\directx\cgraphics.cpp(115) : error C2065: 'IID_IDirectInput8' : undeclared identifier
c:\documents and settings\directx\cgraphics.cpp(116) : error C2065: '_dinput' : undeclared identifier
It simply doesn't exist to the compiler, and after looking at the header file I noticed that DIRECTINPUT_VERSION is 0x0800 by DEFAULT! For some reason the compiler isn't processing it?
#define DIRECTINPUT_HEADER_VERSION *0x0800
#ifndef DIRECTINPUT_VERSION
#define DIRECTINPUT_VERSION DIRECTINPUT_HEADER_VERSION
#endif
further down....
#if DIRECTINPUT_VERSION > 0x0700
extern HRESULT WINAPI DirectInput8Create(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID *ppvOut, LPUNKNOWN punkOuter);
#else
extern HRESULT WINAPI DirectInputCreateA(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTA *ppDI, LPUNKNOWN punkOuter);
extern HRESULT WINAPI DirectInputCreateW(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTW *ppDI, LPUNKNOWN punkOuter);
My question is why do I have access to DirectInputCreateA() but not DirectInput8Create() when I have even specifically defined a version of 0x0800...I'm using VC++ but it has to be the compiler =\