Sign in to follow this  

Error With Creating DirectInput Object

Recommended Posts

Hi, I'm trying to use DirectInput for keyboard control in an assignment I'm working on, but I can't get past creating the DirectInput object. Here is what I have for that: HRESULT hr; // create an LPDIRECTINPUT8 object to hold the DirectInput object LPDIRECTINPUT8 InputObject; // create the DirectInput object hr = DirectInput8Create(hInst, DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&InputObject, NULL); // return false if creating the DI object fails if FAILED( hr ) return false; I get no compiler error, but the program exits as soon as it starts running because it evidently must have failed. I've looked over the code and tried to solve this for hours but I am not getting anywhere. Can anyone tell me what I'm doing wrong? Thanks!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this