My application continuously does bulk read transfers. If I don't initiate the reads, the exception doesn't occur.
So, when closing the application, it's possible that a transfer could be pending.
How can I abort the transfer before closing the application?
I tried: WinUsb_AbortPipe(myDevInfo.winUsbHandle, myDevInfo.bulkInPipe);
But doesn't seem to work.
A temp workaround is to have a delay before exit, this gives time for the ongoing transfer to complete, but this will not work all the time...