资 源 简 介
CSerialPort:: CSerialPort(){单独监禁= FALSE;m_hComm= NULL;//初始化重叠结构成员为零m_ov.Offset= 0;m_ov.OffsetHigh= 0;//创建活动m_ov.hEvent= NULL;m_hWriteEvent= NULL;m_hShutdownEvent= NULL;m_hErrorEvent= NULL;m_hSendCompleteEvent= NULL;m_bThreadAlive= FALSE;m_bSendNotify= FALSE;m_SendList.clear();//初始化关键部分:: InitializeCriticalSection(m_csCommunicationSync);:: InitializeCriticalSection(m_csSendList);}////删除动态内存//CSerialPort::〜CSerialPort(){ReleasePort();:: DeleteCriticalSection(m_csCommunicationSync);:: DeleteCriticalSection(m_csSendList);}无效CSerialPort:: ReleasePort(){而(m_bThreadAlive){而::休眠(1)(m_SendList.empty()!); //2012-09-27zhaoz修复停止仪器采集后数据报文发送不出去问题SetEvent的(m_hShutdownEvent);睡眠(1);}<