Original Post
I'm having issues with getting the state of the mouse in managed DirectInput. I've scoured the forums, searched for tutorials, but so far I've come up empty. I'm using the Visual C# 2005 Express Beta. It throws an "ArgumentException" when I try to get the device state. I've tried different cooperative levels, and Ive tried different parameters to the call to GetDeviceState. All yield the same result. Does anyone know whats wrong? If you think I would be better off not using DirectInput for my mouse can you tell me why? thanks in advance!
mouse.SetCooperativeLevel(parent, CooperativeLevelFlags.NonExclusive | CooperativeLevelFlags.Foreground);
mouse.SetDataFormat(DeviceDataFormat.Mouse);
mouse.Acquire();
return mouse.GetDeviceState(typeof(MouseState));