⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 新建 文本文档.txt

📁 串口通信程序.rar
💻 TXT
字号:
BEGIN_MESSAGE_MAP(CSerialPortTestDlg,CDialog)
	//{{AFX_MSG_MAP(CSerialPortTestDlg)
	ON_MESSAGE{WM_COMM_RXCHAR,OnComm}
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

	//自己添加的BEGIN
	//{{AFX_MSG(CSCPortTestView)
	afx_msg LONG OnComm(WPARAM ch,LPARAM port);
	//}}AFX_MSG
	//自己添加的END



 CSerialPortTestDlg message handlers
LONG CSerialPortTestDlg::OnComm(WPARAM ch,LPARAM port)
{
    m_strEditReceiveMsg+=ch;
	UpdateData(FALSE);
	return 0;
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
	//{{AFX_MSG_MAP(CAboutDlg)
		// No message handlers
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()






	void ClosePort();
void CSerialPort::ClosePort()
{
		SetEvent(m_hShutdownEvent);
}

/*
void CSerialPort::ClosePort()
{
	do
	{
		SetEvent(m_hShutdownEvent);
	} while (m_bThreadAlive);

	
	// if the port is still opened: close it 
	if (m_hComm != NULL)
	{
		CloseHandle(m_hComm);
		m_hComm = NULL;
	}
	// Close Handles  
	if(m_hShutdownEvent!=NULL)
		CloseHandle( m_hShutdownEvent); 
	if(m_ov.hEvent!=NULL)
		CloseHandle( m_ov.hEvent ); 
	if(m_hWriteEvent!=NULL)
		CloseHandle( m_hWriteEvent ); 

	TRACE("Thread ended\n");
	delete [] m_szWriteBuffer;
}

*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -