Original Post
ok, i''m using DirectInput8 for my game and i am having a very annoying problem. i have the runtimes and the sdk installed properly.
basically, when i call DirectInput8Create in my initialization function, it fails and doesn''t return any of the error codes in the MS documentation. here is the snippet of my function:
bool cInputSystem::Initalize(HWND hWnd, HINSTANCE hInstance)
{
HRESULT retVal;
retVal = DirectInput8Create(hInstance, DIRECTINPUT_VERSION, IID_IDirectInput8, (void **)lpDI, NULL);
if (retVal != DI_OK)
{
switch (retVal)
{
case DIERR_BETADIRECTINPUTVERSION:
{
MessageBox(hWnd, "DIERR_BETADIRECTINPUTVERSION", "ERROR", MB_OK);
break;
}
case DIERR_INVALIDPARAM:
{
MessageBox(hWnd, "DIERR_INVALIDPARAM", "ERROR", MB_OK);
break;
}
case DIERR_OLDDIRECTINPUTVERSION:
{
MessageBox(hWnd, "DIERR_OLDDIRECTINPUTVERSION", "ERROR", MB_OK);
break;
}
case DIERR_OUTOFMEMORY:
{
MessageBox(hWnd, "DIERR_OUTOFMEMORY", "ERROR", MB_OK);
break;
}
default:
{
MessageBox(hWnd, "Unknown DirectInput Creation Error", "ERROR", MB_OK);
break;
}
}
return false;
}
keyboard = new cKeyboard(lpDI, hWnd);
mouse = new cMouse(lpDI, hWnd);
if (!keyboard || !mouse)
{
MessageBox(hWnd, "Couldn''t Create keyboard and mouse!", "ERROR", MB_OK);
return false;
}
return true;
}
basically the result that it gives me is "Unknown DirectInput Creation Error", so i have no idea why it is screwing up, or even how for that matter.
any ideas?
if you need to see some more snippets, just tell me.
thanks!