Skip to main content
gamedev.net
🔒 Locked

direct input problem

Started by hibiki_konzaki Jun 14, 2002 at 3:07 PM 3 replies 300+ views
Original Post
hibiki_konzaki
hibiki_konzaki
In my start up code, I get 2 errors: C:\Program Files\Microsoft Visual Studio\MyProjects\editor1\killthacraka.cpp(174) : error C2065: ''DirectInputCreate'' : undeclared identifier C:\Program Files\Microsoft Visual Studio\MyProjects\editor1\killthacraka.cpp(177) : error C2664: ''CreateDeviceEx'' : cannot convert parameter 3 from ''struct IDirectInputDeviceA ** '' to ''void ** '' heres what it''s saying is wrong: if(FAILED(DirectInputCreate(main_window_handle,DIRECTINPUT_VERSION,IID_IDirectInput7,&lpdi,NULL))) return(0); if(FAILED(lpdi->CreateDeviceEx(GUID_SysKeyboard,IID_IDirectInputDevice7,&lpdikeyboard,NULL))) return(0); Me and my friend can''t figure it out. All the correct libs are linked, I included the headers. I''m using DX7 for this with DirectDraw.
Evil Bill
Evil Bill
Shouldn''t ''DirectInputCreate'' be ''DirectInputCreate7'' or osmething similar? Or you''re not including ''dinput.lib''. (or whatever its called)


  
if(FAILED(lpdi->CreateDeviceEx(GUID_SysKeyboard,IID_IDirectInputDevice7,&lpdikeyboard,NULL)))
return(0);

should be:
if(FAILED(lpdi->CreateDeviceEx(GUID_SysKeyboard,IID_IDirectInputDevice7,(void**)&lpdikeyboard,NULL)))
return(0);


HTH, Steve

Steve
DirectX Programmer
Soon to be the new Bill Gates
Member of the Unban Mindwipe Society (UMWS)
Colin Jeanne
Colin Jeanne
I think the function should be CreateDirectInputEx() if you are using DirectInput7



I will not make a list of links... I will not make a list of links... I will not make a list of links...
Invader''s Realm
hibiki_konzaki
hibiki_konzaki
I tried that too. Thats what I had originally, but I forgot to change it back. I got the same results with it too.

Hibiki
Wheres the any key?
IndirectX
IndirectX
Try defining DIRECTINPUT_VERSION to 0x0700. By default, dinput.h includes only DX8 creation function.

For your second error, you need what Evil Bill said.
---visit #directxdev on afternet <- not just for directx, despite the name

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.