In LONG CSerialPortTestDlg: : OnCommunication (WPARAM ch, LPARAM port) function immediately after the conclusion of the accept close a serial port m_Com. ClosPort (); Not completely closed, open for a second time to a serial port card dead, your bosses to solve!