On 6/3/08, Ruben J=F6nsson wrote: > The problem is in WinUsbDevice.CloseDeviceHandle(): > > if (!(myDevInfo.deviceHandle.IsInvalid)){ > > since myDevInfo.deviceHandle is null. You can fix this by testing the > deviceHandle for null. > Thanks. > > The real problem is that the try/catch is rethrown without handling it wh= ich is > the same as not having any try/catch at all. Remove the throw and it will= also > work. I am not sure why you would rethrow without doing anything with the > exception instead of not catching it at all. I also feel it is strange but I do not know how to fix it. This is not my progrgam. It is written by the famous Jan Axelson, the author of the famous "USB Complete" and other books. Xiaofan -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist