Jump to content
  • Advertisement
Sign in to follow this  
zacrazyman

DirectInputCreate for Dx3 & DX7 help

This topic is 5004 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi folks, I'm using CDX wrapper to create a game that is compatible under DX3 and DX7 (allow joystick support). I have everything structured in classes managed by a window wrapper class I'm having trouble with DirectInput when I create it. Basically, I call:
[cpp]
//earlier I called
#define DIRECTINPUT_VERSION 0x0700
#include <dinput.h>
#include <CDXInput.h>  // CDX wrapper for DInput
#pragma comment(lib, "dinput.lib") // i tried this before and after #include

// and...
LPDIRECTINPUT m_lpDI;
// then I create the Input device (in CDXInput.h/cpp)
HRESULT hr = DirectInputCreate( hInst, DIRECTINPUT_VERSION, &m_lpDI, NULL); 
[/cpp]
The result I'm getting is DIERR_INVALIDPARAM. I checked around no one seems to be having this exact problem (not that google can find anyways!) The routine works fine when DIRECTINPUT_VERSION is set to 0x0300 but not anything higher The problem further complicated by this: I ran another program that uses DInput (though CDX wrapper), the other program is practically identical to the code above, and it works fine for the same parameters. I checked as much of the project settings against the other and no major difference was found. NB: I tried linking to dinput.lib either DX9 or DX7 SDK and the problem persisted. But with the app that was working it didnt matter which version of the lib I linked to I've checked that the libs are in the right order in the settings. DirectInputCreate is supposed to have compatibility for DIRECTINPUT_VERSION 0x0300 through 0x0700. What would make the function only work for 0x0300 and not the others?? What am I missing? Many thanks!!

Share this post


Link to post
Share on other sites
Advertisement
i remember working with this issue before...
i'll try to find the thread.
but i believe that DIINPUT VER 3 works from 3 to 6.1 and then everything is updated for 7, 8, and 9.

i look.

edit: http://www.gamedev.net/community/forums/viewreply.asp?ID=1885409

Share this post


Link to post
Share on other sites
thanks for your reply,

"In it's place, try using either 0x0300, 0x0500 or 0x0700."

I'm using 0x0700 and 0x0300 and it's 0x0700 that is not working. So sadly that discussion doesn't cover my problem. Any other ideas?

Thanks again

Share this post


Link to post
Share on other sites
You've got a LPDIRECTINPUT interface listed...have you tried using an LPDIRECTINPUT7 interface?

MS did some switching up starting with the DX7 SDK and the whole "use-Query-Interface-Like-a-Good-COM-should" routine..

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!