Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / General Programming / DirectInputCreate help! Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
Jake Wolf

March 29, 2005, 09:50 AM

Hi folks, I'm using CDX wrapper to create a game that is compatible under DX3 and DX7 (allow joystick support)

I'm having trouble with DirectInput when I create it.

Basically, I call:

  1.  
  2.  
  3. //earlier I called
  4. #define DIRECTINPUT_VERSION 0x0700
  5.  
  6. #include <dinput.h>
  7. #include <CDXInput.h>  // CDX wrapper for DInput
  8. #pragma comment(lib, "dinput.lib") // i tried this before and after #include
  9.  
  10. // and...
  11. LPDIRECTINPUT m_lpDI;
  12.  
  13. // then I create the Input device (in CDXInput.h/cpp)
  14. HRESULT hr = DirectInputCreate( hInst, DIRECTINPUT_VERSION, &m_lpDI, NULL);
  15.  


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 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

What am I missing?

Many thanks!!

 
Jake Wolf

March 29, 2005, 09:57 AM

Oh and one more thing, when I define DIRECTINPUT_VERSION 0x0300 everything works fine, it only cuts out for version 7.

 
This thread contains 2 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.