Original Post
I have a quick question: I am attempting to initialize a Direct Input device in DX 9.0. The input device pointer is located inside a class as follows: class DXInput { public: HRESULT InitializeDirectInputDevice(HINSTANCE hInstance); ... ... private: LPDIRECTINPUT8 pDInputObject; ... ... }; Inside the InitializeDirectInputDevice method is the following: { ... ... hr = DirectInput8Create(hInstance, DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&pDInputObject, NULL); if (FAILED(hr)) return E_FAIL; ... ... return S_OK; } Yet this does not work. It works when the LPDIRECTINPUT8 object IS NOT a member of the class, but not when it IS a member. Could somebody please tell me what I am doing wrong, or if it is a legitimate way to do it at all?