Reopening serial port fails if not closed properly with CloseHandle

Posted by superg on Stack Overflow See other posts from Stack Overflow or by superg
Published on 2010-06-01T09:03:28Z Indexed on 2010/06/01 11:43 UTC
Read the original article Hit count: 235

Filed under:
|
|
|

I am working with USB device on Windows that is seen as a virtual serial port. I can communicate with the device using CreateFile and ReadFile functions, but in some cases my application does not call CloseHandle (when my application in development crashes). After that all calls to CreateFile fail (ERROR_ACCESS_DENIED), and the only solution is to log in to my computer again. Is there any way to force closing the open handle (or reopening) programmatically?

© Stack Overflow or respective owner

Related posts about c++

Related posts about Windows