Original Post
I get this exception
Quote:With this code. I have no idea how to fix it.
System.ArgumentException was unhandled Message="Value does not fall within the expected range." Source="Microsoft.DirectX" StackTrace: at Microsoft.DirectX.DirectInput.Device.Acquire() at SoC.Core.Input.cMouse..ctor(Form window) in C:\Documents and Settings\ryan\Desktop\soc\SoC\Core\Input\cMouse.cs:line 24 at SoC.Core.cDirectX..ctor(Form window) in C:\Documents and Settings\ryan\Desktop\soc\SoC\Core\cDirectX.cs:line 27 at SoC.cKernel..ctor() in C:\Documents and Settings\ryan\Desktop\soc\SoC\cKernel.cs:line 35 at SoC.main.Main(String[] args) in C:\Documents and Settings\ryan\Desktop\soc\SoC\main.cs:line 18 at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
_mouse = new Microsoft.DirectX.DirectInput.Device(SystemGuid.Keyboard);
_mouse.SetCooperativeLevel(_window.Handle, CooperativeLevelFlags.Foreground | CooperativeLevelFlags.NonExclusive);
_mouse.Acquire();