arvydas / BlinkStickDotNet

BlinkStick .NET interface to control devices connected to the computer
GNU General Public License v3.0
32 stars 28 forks source link

Removing or inserting other USB devices while running crashes the program #12

Open erSitzt opened 5 months ago

erSitzt commented 5 months ago

When i use Blinkstick in a Windows Forms app, i get the following error, as soon as i have this line of code. I'm inserting/removing a usb-headset to test this. Happend with all types of usb i have here.

led = BlinkStick.FindFirst();

System.OverflowException
  HResult=0x80131516
  Nachricht = Arithmetic operation resulted in an overflow.
  Quelle = System.Private.CoreLib
  Stapelüberwachung:
   bei System.IntPtr.ToInt32()
   bei LibUsbDotNet.DeviceNotify.WindowsDeviceNotifier.OnDeviceChange(Message& m)
   bei LibUsbDotNet.DeviceNotify.Internal.DevNotifyNativeWindow.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam)