Search code examples
c++dllxnawinapixinput

Which version of the Windows SDK uses xinput1_3.dll?


I currently have Windows SDK 7.0A installed. This version of the SDK contains Xinput.h which references xinput9_1_0.dll:

#define XINPUT_DLL_A  "xinput9_1_0.dll"

I need my program to use xinput1_3.dll instead. I figured that in order to do this, I must link with the xinput.lib file from an earlier version of Windows SDK.

But, which version of the SDK contains the Xinput.h file that references xinput1_3.dll?


Solution

  • I think the solution is actually to use the Microsoft DirectX SDK (June 2010) by modifying the include and library dirs for your project. The XInput.h file from the DirectX SDK...

    // XInput.h from the DirectX SDK
    
    #ifndef XINPUT_USE_9_1_0
    #define XINPUT_DLL_A  "xinput1_3.dll"
    #define XINPUT_DLL_W L"xinput1_3.dll"
    #else
    #define XINPUT_DLL_A  "xinput9_1_0.dll"
    #define XINPUT_DLL_W L"xinput9_1_0.dll"
    #endif
    #ifdef UNICODE
        #define XINPUT_DLL XINPUT_DLL_W
    #else
        #define XINPUT_DLL XINPUT_DLL_A
    #endif 
    

    ... is actually a little different to the one from the Windows SDK...

    // XInput.h from the Windows SDK
    
    #define XINPUT_DLL_A  "xinput9_1_0.dll"
    #define XINPUT_DLL_W L"xinput9_1_0.dll"
    #ifdef UNICODE
        #define XINPUT_DLL XINPUT_DLL_W
    #else
        #define XINPUT_DLL XINPUT_DLL_A
    #endif 
    

    So, by default, the DirectX SDK will actually use xinput1_3.dll.