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

📄 common_serialdlg.h

📁 同时可以打开两个串口的程序。可以进行收发试验。
💻 H
字号:
// ComMonDlg.h : header file
//

#if !defined(AFX_COMMON_SERIALDLG_H__E92D1D58_7401_4167_99F9_7EECEDD06A97__INCLUDED_)
#define AFX_COMMON_SERIALDLG_H__E92D1D58_7401_4167_99F9_7EECEDD06A97__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CSerialPort;

/////////////////////////////////////////////////////////////////////////////
// CComMon_SERIALDlg dialog

class CComMon_SERIALDlg : public CDialog
{
// Construction
public:
	CComMon_SERIALDlg(CWnd* pParent = NULL);	// standard constructor

	virtual ~CComMon_SERIALDlg();

// Dialog Data
	//{{AFX_DATA(CComMon_SERIALDlg)
	enum { IDD = IDD_COMMON_DIALOG };
	CRichEditCtrl	m_reRecv2;
	CRichEditCtrl	m_reRecv1;
	CRichEditCtrl	m_reSend2;
	CRichEditCtrl	m_reSend1;
	CEdit	m_eSendCycle2;
	CEdit	m_eSendCycle1;
	CButton	m_chNotRecv;
	CButton	m_chTransmit1And2;
	CButton	m_chSendHex2;
	CButton	m_chSendHex1;
	CButton	m_chAutoSnd2;
	CButton	m_chAutoSnd1;
	CButton	m_chRcvHex2;
	CButton	m_chRcvHex1;
	CButton	m_chAutoNLine2;
	CButton	m_chAutoNLine1;
	CComboBox	m_cSelParity2;
	CComboBox	m_cSelParity1;
	CComboBox	m_cSelCom2;
	CComboBox	m_cSelCom1;
	CComboBox	m_cSelStopbit2;
	CComboBox	m_cSelStopbit1;
	CComboBox	m_cSelDatabit2;
	CComboBox	m_cSelDatabit1;
	CComboBox	m_cSelBaud2;
	CComboBox	m_cSelBaud1;
	CButton	m_bstartcom2;
	CButton	m_startcom1;
	CButton	m_bSend2;
	CButton	m_bSend1;
	CString	m_sSelBaud2;
	CString	m_sSelDatabit1;
	CString	m_sSelDatabit2;
	CString	m_sSelStopbit2;
	CString	m_sSelCom1;
	CString	m_sSelCom2;
	CString	m_sSelBaud1;
	CString	m_sSelParity1;
	CString	m_sSelParity2;
	CString	m_sSelStopbit1;
	CString	m_sRESnd1;
	CString	m_sRERcv1;
	CString	m_sRERcv2;
	CString	m_sRESnd2;
	CString	m_sComState1;
	CString	m_sComState2;
	int		m_nRecvBytes1;
	int		m_nRecvBytes2;
	int		m_nSendBytes1;
	int		m_nSendBytes2;
	int		m_nSendCycle1;
	int		m_nSendCycle2;
	int		m_nBufSize;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CComMon_SERIALDlg)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	void ResumeSerial(int nSel);
	void LookupSerialState();
	void ConfigChange(int nSel);
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CComMon_SERIALDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnCOK();
	afx_msg void OnCCancel();
	afx_msg void OnStartCom1();
	afx_msg void OnStartCom2();
	afx_msg void OnSend1();
	afx_msg void OnSend2();
	afx_msg void OnTransmit_1AND2();
	afx_msg void OnAutoRcvSnd1();
	afx_msg void OnAutoRcvSnd2();
	afx_msg void OnEditchangeCom1();
	afx_msg void OnEditchangeBaud1();
	afx_msg void OnEditchangeDatabit1();
	afx_msg void OnEditchangeCheckbit1();
	afx_msg void OnEditchangeStopbit1();
	afx_msg void OnEditchangeCom2();
	afx_msg void OnEditchangeBaud2();
	afx_msg void OnEditchangeDatabit2();
	afx_msg void OnEditchangeCheckbit2();
	afx_msg void OnEditchangeStopbit2();
	afx_msg void OnSelchangeSelCheckbit1();
	afx_msg void OnSelchangeSelBaud1();
	afx_msg void OnSelchangeSelBaud2();
	afx_msg void OnSelchangeSelCheckbit2();
	afx_msg void OnSelchangeSelCom1();
	afx_msg void OnSelchangeSelCom2();
	afx_msg void OnSelchangeSelDatabit1();
	afx_msg void OnSelchangeSelDatabit2();
	afx_msg void OnSelchangeSelStopbit1();
	afx_msg void OnSelchangeSelStopbit2();
	afx_msg void OnClearRcv1();
	afx_msg void OnClearSnd1();
	afx_msg void OnClearRcv2();
	afx_msg void OnClearSnd2();
	afx_msg void OnClearCount1();
	afx_msg void OnClearCount2();
	afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnChangeESendCycle1();
	afx_msg void OnChangeESendCycle2();
	afx_msg void OnChangeRESend1();
	afx_msg void OnChangeRESend2();
	afx_msg void OnSelChangeRESend1(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnSaveData1();
	afx_msg void OnSaveData2();
	afx_msg void OnAutoNLine1();
	afx_msg void OnAutoNLine2();
	afx_msg void OnAutoSnd1();
	afx_msg void OnAutoSnd2();
	//}}AFX_MSG
	afx_msg LRESULT OnInitInterface(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnComRXChars(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnCommEvent(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnCommError(WPARAM wParam, LPARAM lParam);
	DECLARE_MESSAGE_MAP()

	CPtrArray	m_aPorts;
	CByteArray	m_aByteRcv1;
	CByteArray	m_aByteSnd1;
	CByteArray	m_aByteRcv2;
	CByteArray	m_aByteSnd2;

	BOOL		m_bComNO1_Open;
	BOOL		m_bComNO2_Open;
	BOOL		m_bClock1_Open;
	BOOL		m_bClock2_Open;
	long m_nSelS, m_nSelE;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_COMMON_SERIALDLG_H__E92D1D58_7401_4167_99F9_7EECEDD06A97__INCLUDED_)

⌨️ 快捷键说明

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