Skip to main content
GameDev.net gamedev.net
🔒 Locked

DirectInputCreate

Started by MrRage Jan 18, 2005 at 9:09 PM 5 replies 5.8k views
Original Post
MrRage
MrRage
I'm trying to port over a simple DirectInputCreate example in MSVC++ .NET and its not linking. I get error LNK2019: unresolved external symbol _DirectInputCreate referenced. I have DirectX 9 and I am including dxguid.lib dinput.lib dinput8.lib in my project. So there might be some kind of compatablility probem with DirectInputCreate. Anyone have an idea?
Dave Hunt
Dave Hunt
Try DirectInput8Create(). Note the '8' in the name.
MrRage
MrRage
ahhh... well anyone know what I might be missing?

LPDIRECTINPUT                   g_lpDI = NULL;  // Create the DirectInput COM object. //if(DirectInputCreate(hinst, DIRECTINPUT_VERSION, &g_lpDI, NULL) != DI_OK)   if(DirectInput8Create(hinst, 0x0300, &g_lpDI, NULL) != DI_OK){...}I need a 5th item for DirectInput8CreateHRESULT WINAPI DirectInput8Create(              HINSTANCE hinst,  // got this..    DWORD dwVersion,  // got this..    REFIID riidltf,       // I'm lost here...    LPVOID *ppvOut,       // I'm lost here...    LPUNKNOWN punkOuter   // And I'm lost here...);
Mercury
Mercury
Quote:
Original post by MrRage
ahhh... well anyone know what I might be missing?

LPDIRECTINPUT                   g_lpDI = NULL;  // Create the DirectInput COM object. //if(DirectInputCreate(hinst, DIRECTINPUT_VERSION, &g_lpDI, NULL) != DI_OK)   if(DirectInput8Create(hinst, 0x0300, &g_lpDI, NULL) != DI_OK){...}I need a 5th item for DirectInput8CreateHRESULT WINAPI DirectInput8Create(              HINSTANCE hinst,  // got this..    DWORD dwVersion,  // got this..    REFIID riidltf,       // I'm lost here...    LPVOID *ppvOut,       // I'm lost here...    LPUNKNOWN punkOuter   // And I'm lost here...);


pUnkOuter is COM weirdness, just set it to NULL for now, you don't really need to know what it does anyway, I don't. [smile]

From DirectX SDK Docs:
Quote:

riidltf
Unique identifier of the desired interface. This value is IID_IDirectInput8A or IID_IDirectInput8W. Passing the IID_IDirectInput8 define selects the ANSI or Unicode version of the interface, depending on whether UNICODE is defined during compilation.
ppvOut
Address of a pointer to a variable to receive the interface pointer if the call succeeds.
MrRage
MrRage
crap.. my code is old and broke.. dose anyone have a link to a tutorial on how to do DirectX9 Input?
Mercury
Mercury
Quote:
Original post by MrRage
crap.. my code is old and broke.. dose anyone have a link to a tutorial on how to do DirectX9 Input?

DirectInput is a relatively easy API to learn, all that you would need to know is included in the DirectX SDK documentation. There are five or six tutorials there that just about cover the entire API, the rest is documented quite well in close to the same place.
MrRage
MrRage
Cool thanks, I'm going to look at that tonight

Topic Locked

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

Sign in to reply to this topic.