Ok, having just downloaded the latest DirectX SDK and Platform SDK, so I could test this in 64bit, I created an insanely simple 64bit application.
For the stdafx.h file I added:
#define DIRECTINPUT_VERSION 0x0800
#include <Dinput.h>
and in the _tWinMain function I added:
void *outPtr = NULL;
HRESULT aResult = DirectInput8Create(hInstance, DIRECTINPUT_VERSION, IID_IDirectInput8, &outPtr, NULL);
if (aResult != DI_OK) {
LPCWSTR emesg = L"??";
switch (aResult) {
case DIERR_BETADIRECTINPUTVERSION: emesg = L"Beta Directinput version"; break;
case DIERR_INVALIDPARAM: emesg = L"Invalid Parameter"; break;
case DIERR_OLDDIRECTINPUTVERSION: emesg = L"Old Directinput Version"; break;
case DIERR_OUTOFMEMORY: emesg = L"Out of Memory"; break;
}
MessageBox(GetDesktopWindow(), emesg, emesg, 0);
}
for linker options, I added dinput8.lib and dxguid.lib
Compiled, checked that the application was 64bit, and it executes cleanly without generating an invalid parameter message. I get a valid value in the outPtr variable. I even looked at the content of the dinput.h file, which seems to indicate that DIRECTINPUT_VERSION is set to 0x0800 be default.
I'm at a loss, this 'just should work' in both 32bit and 64bit.
I get an invalid pointer error when I use a NULL value instead of outPtr, so that seems to indicate that the issue isn't an invalid value from the pointer.
I do get an invalid parameter when I use anything other than a valid hInstance - when I replaced the value with 0, I got the same error you saw. Perhaps the hInstance value is not initialized correctly?