Original Post
Please I''m trying to understand what''s going wrong with this piece of code :
//includes...dinput.h and others
extern HINSTANCE hGlobalInstance ;
LPDIRECTINPUT8 lpDI8 ;
LPDIRECTINPUTDEVICE8 lpDIDV8 ;
HRESULT hr ;
void CreateDIObject(void) //declarations included in headers
{
hr = DirectInput8Create(hGlobalInstance,DIRECTINPUT_VERSION,
&IID_IDirectInput8,NULL);
//using & before GUID ''cause the code is C
if (FAILED(hr)) //...do something
}
// the previous function works
// but following one that causes problems...
void CreateDIDevice(void)
{
hr = lpDI8->CreateDevice(&GUID_SysKeyboard,&lpDIDV8,NULL)
if (FAILED(hr))//do something...
}
this is the error I get from compiler :
Compiling...
app_input.c
C:\msvc++\unisoft\app_input.c(31) : error C2039: ''CreateDevice'' : is not a member of ''IDirectInput8A''
c:\dxsdk\include\dinput.h(2622) : see declaration of ''IDirectInput8A''
Error executing cl.exe.
Creating browse info file...
unisoft.exe - 1 error(s), 0 warning(s)
I''ve set the right paths and included necessary headers and libs(i mean dinput8.lib dxguid.lib ...)
Maybe it''s a simple question but it really get me stuck.
If someone could give me a hint I''le be very grateful.
Thanks in advance