Skip to main content
gamedev.net
🔒 Locked

DirectInput problem

Started by Slider38 0 replies 650+ views
Original Post
Slider38
Slider38
Hi Folks, Well, I''m trying to use DirectInput for the first time, and seem to have hit a wall. Need some advice here. At the top of my program I have a line: #define DIRECTINPUT_VERSION 0x0700 This is above my include of dinput.h. In my initialization I have: if (FAILED(DirectInputCreateEx(hinstance_app, DIRECTINPUT_VERSION, IID_IDirectInput7, (void**)&lpdi,NULL))) return(0); // create a mouse device /////////////////////////////// if (FAILED(lpdi->CreateDeviceEx(GUID_SysMouse, IID_IDirectInputDevice7, (void**)&lpdimouse, NULL))) return(0); This isn''t aligning very well, but I think the calls are ok. When I try to compile I get this error: C:\Program Files\Microsoft Visual Studio\MyProjects\NewDraw\NewDraw.cpp(733) : error C2039: ''CreateDeviceEx'' : is not a member of ''IDirectInputA'' c:\dx8vcsdk\include\dinput.h(2374) : see declaration of ''IDirectInputA'' Error executing cl.exe. I can''t figure out why the dinput.h is looking at IDirectInputA. I thought that the define statement for version would direct DirectX8 to look at the proper section of the header file. I''ve looked at the header. The directx7 stuff is there. I have to be missing something basic, but I''m stumped. Any help would sure be appreciated. Thanks, Slider
Slider38
Slider38
Never mind. A dumb mistake finally discovered. I did not use the correct type, and therefore, DX8 was getting lost. Once I corrected my types to LPDIRECTINPUT7 and LPDIRECTINPUTDEVICE7, the code compiles - no problem. I''m using a book and some code to get me going, written before DX7 came out. For other rookies, be forewarned Slider

Topic Locked

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

Sign in to reply to this topic.