Original Post
I am trying to setup my direct input mouse device but keep getting am invalid argument error on the SetDataFormat(&c_dfDIMouse) function. Here is the entire code: hr = Pipe.g_lpDID->CreateDevice(GUID_SysKeyboard, &Pipe.g_Keyboard, NULL); hr = Pipe.g_Keyboard->SetCooperativeLevel(hwnd, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE); // This passes just fine hr = Pipe.g_Keyboard->SetDataFormat(&c_dfDIKeyboard); hr = Pipe.g_lpDID->CreateDevice(GUID_SysKeyboard, &Pipe.g_Mouse, NULL); hr = Pipe.g_Mouse->SetCooperativeLevel(hwnd, DISCL_EXCLUSIVE | DISCL_FOREGROUND); // This one doesn't hr = Pipe.g_Mouse->SetDataFormat(&c_dfDIMouse); hr = Pipe.g_Mouse->Acquire(); I've also tried c_dfDIMouse2, but still got the same error (hr = E_INVALIDARG). I've tried to place the SetDataFormat function before the SetCooperativeLevel funciton like MS has in the direct input example, but still didn't work. Any help? Thanks a bunch.