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

📄 commtestdlg.h

📁 实现串口通信测试的程序
💻 H
字号:
// CommTestDlg.h : header file
//
//{{AFX_INCLUDES()
#include "mscomm.h"
//}}AFX_INCLUDES

#if !defined(AFX_COMMTESTDLG_H__2BF92047_D625_11D7_82C9_0000E8D3D16F__INCLUDED_)
#define AFX_COMMTESTDLG_H__2BF92047_D625_11D7_82C9_0000E8D3D16F__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CCommTestDlg dialog

#include "Setport.h"

# define WR_DRAW WM_USER+1


class CCommTestDlg : public CDialog
{
// Construction
public:
	int ReceiveData( int CommEvent);
	void initParams();
	CString OpenFile();
	CCommTestDlg(CWnd* pParent = NULL);	// standard constructor
public:
	void OnUpdateTBottonStatus( int  idButton, BOOL fEnable);
	void SetSBtext(int position,LPSTR szText,int nText);
	void mesbox(  DWORD c);
	void OnWRdraw();
	void drawW(int color);
	void drawR(int color);
	RECT  m_r;  // reaad;
	RECT  m_w;   //
	RECT  m_regin;
protected:
		CToolBar m_wndToolBar;

// Dialog Data
	//{{AFX_DATA(CCommTestDlg)
	enum { IDD = IDD_COMMTEST_DIALOG };
	CButton	m_hexreceive;
	CButton	m_hexsend;
	CMSComm	m_comm;

	int		m_maxLen;	
	int		m_sendTime;
	int m_SendDataLen;
	int CurrentPort ;
	int Len_Receive;

	CString	m_SendData;
	CByteArray m_Sendhexdata;
	CString	m_ReceiveData;

    BOOL m_AutoSend;
	USEMODE SendMode;
	USEMODE ReceiveMode;

	CUR_SETS  PortInfo;
	DRAWMODE  drawPortSet;
	BOOL   PortIsOpen;

	HWND hStatusWindow;
	
	//}}AFX_DATA

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

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CCommTestDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnClear();
	afx_msg void OnClosePort();
	afx_msg void OnOpenFile();
	afx_msg void OnOpenPort();
	afx_msg void OnSend();
	afx_msg void OnSetPort();
	afx_msg void OnAsciiReceive();
	afx_msg void OnHexReceive();
	afx_msg void OnAsciiSend();
	afx_msg void OnHexSend();
	afx_msg void OnOnComm();
	afx_msg void OnAutosend();
	afx_msg void OnChangeSend();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnUpdateOpenPort(CCmdUI* pCmdUI);

	DECLARE_EVENTSINK_MAP()
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_COMMTESTDLG_H__2BF92047_D625_11D7_82C9_0000E8D3D16F__INCLUDED_)

⌨️ 快捷键说明

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