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

📄 sportdlg.h

📁 CSerialPort类使用示例
💻 H
字号:
// SPortDlg.h : header file
//

#if !defined(AFX_SPORTDLG_H__7C1ED5DA_4616_4B97_A2A4_7881F714EDCE__INCLUDED_)
#define AFX_SPORTDLG_H__7C1ED5DA_4616_4B97_A2A4_7881F714EDCE__INCLUDED_

#include "SerialPort.h"	// Added by ClassView
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CSPortDlg dialog

class CSPortDlg : public CDialog
{
// Construction
public:
	int nTX;
	int nRX;
	CString RecvASC(CString strRecv);
	CString SendASC(CString strCmd);
	char GetCheck(CString strCmd);
	BOOL m_bSerialPortOpened;  //标志串口是否打开
	CSerialPort Sp;			   //CSerailPort类对象

	CSPortDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CSPortDlg)
	enum { IDD = IDD_SPORT_DIALOG };
	CButton	m_CtrlNewLine;
	CButton	m_CtrlCheck;
	CButton	m_CtrlASCShow;
	CButton	m_CtrlASCSend;
	CComboBox	m_CtrlCom;
	CString	m_strRate;
	CString	m_strParity;
	CString	m_strData;
	CString	m_strStop;
	CString	m_strCom;
	CString	m_strSendMsg;
	CString	m_strReceiveMsg;
	CString	m_strRX;
	CString	m_strTX;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CSPortDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CSPortDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnButtonClear();
	afx_msg void OnButtonOpen();
	afx_msg void OnButtonSend();
	afx_msg LONG OnComm(WPARAM ch, LPARAM port);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_SPORTDLG_H__7C1ED5DA_4616_4B97_A2A4_7881F714EDCE__INCLUDED_)

⌨️ 快捷键说明

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