![](https://csdnimg.cn/release/download_crawler_static/29454874/bg3.jpg)
}
memset(&m_OverlappedRead, 0, sizeof (OVERLAPPED));
memset(&m_OverlappedWrite, 0, sizeof (OVERLAPPED));
COMMTIMEOUTS CommTimeOuts;
CommTimeOuts.ReadIntervalTimeout=0? áFFFFFFFF;
CommTimeOuts.ReadTotalTimeoutMultiplier = 0;
CommTimeOuts.ReadTotalTimeoutConstant = 0;
CommTimeOuts.WriteTotalTimeoutMultiplier = 0;
CommTimeOuts.WriteTotalTimeoutConstant = 5000;
SetCommTimeouts(m_hIDComDev, &CommTimeOuts);
Wsprintf(szComparams, ? °COM2:9600, n, 8, 1? ±);
m_OverlappedRead. hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
m_OverlappedWrite. hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
dcb. DCBlength = sizeof(DCB);
GetCommState(m_hIDComDev, &dcb);
dcb. BaudRate = 9600;
dcb. ByteSize= 8;
unsigned char ucSet;
ucSet = (unsigned char) ((FC_RTSCTS&FC_DTRDSR) != 0);
ucSet = (unsigned char) ((FC_RTSCTS&FC_RTSCTS) ! = 0);
ucSet = (unsigned char) ((FC_RTSCTS&FC_XONXOFF) ! = 0);
if (!SetCommState(m_hIDComDev, &dcb)??