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

📄 rs232dlg.h

📁 自己写的串口调试程序
💻 H
字号:
// RS232Dlg.h : header file
//
//{{AFX_INCLUDES()
#include "mscomm.h"
//}}AFX_INCLUDES

#if !defined(AFX_RS232DLG_H__E341958B_41A2_4FA4_82F3_334C65BB6DEB__INCLUDED_)
#define AFX_RS232DLG_H__E341958B_41A2_4FA4_82F3_334C65BB6DEB__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CRS232Dlg dialog

class CRS232Dlg : public CDialog
{
// Construction
public:
	char ConvertHexChar(char ch);
	int String2Hex(CString str, CByteArray &senddata);
	CRS232Dlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CRS232Dlg)
	enum { IDD = IDD_RS232_DIALOG };
	CStatic	m_ctrlIcon;
	CButton	m_ctrlHexSend;
	CButton	m_ctrlHexdisp;
	CString	m_RXD;
	CString	m_TXD;
	CMSComm	m_Comm;
	CString	m_strBits;
	CString	m_strDataBit;
	CString	m_strParity;
	CString	m_strStopBit;
	CString	m_strStatus;
	int		m_nCom;
	CString	m_strPath;
	CString	m_time;
	//}}AFX_DATA

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

// Implementation
protected:
	void OpenCOM();
	CString m_strSeting;
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CRS232Dlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnButtonSend();
	afx_msg void OnComm();
	afx_msg void OnButtonClose();
	afx_msg void OnButtonClear();
	afx_msg void OnButtonClears();
	afx_msg void OnSelchangeComboCom();
	afx_msg void OnSelchangeComboBits();
	afx_msg void OnSelchangeComboParity();
	afx_msg void OnSelchangeComboData();
	afx_msg void OnSelchangeComboStop();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnButtonAutosend();
	afx_msg void OnButtonFile();
	afx_msg void OnButtonSendfile();
	DECLARE_EVENTSINK_MAP()
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	void SendString(CString str);
	CString m_strFile;
	BOOL m_bAutoSend;
	void ChangSetting();
	void ShowStatus();
	BOOL m_bPortOpen;
	CString parity(CString str);

};

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

#endif // !defined(AFX_RS232DLG_H__E341958B_41A2_4FA4_82F3_334C65BB6DEB__INCLUDED_)

⌨️ 快捷键说明

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