Home > Software engineering >  A serial port communication receiving threads to block the way, how to close a serial port
A serial port communication receiving threads to block the way, how to close a serial port

Time:10-07

When using VC debug serial port, use WaitCommEvent is blocking the way to open the serial port, found that don't need to close a serial port has been shut, and how to solve?

CodePudding user response:

SetCommMask (g____hComm, EV_RXCHAR | EV_TXEMPTY);

To make this look,

CodePudding user response:

This is to set up, not cancelled

CodePudding user response:

SetCommMask (hComm, 0)

CodePudding user response:

OVERLAPPED
If you use this, then the event is certainly know can manually inform it to signaled state, isn't it.
So please use the SetEvent set HANDLE hEvent, signaled, natural return.

If there is no use, please ignore the

  • Related