serialporttestdlg.h

来自「wince系统下的EVC工具下编写的一个串口程序」· C头文件 代码 · 共 80 行

H
80
字号
// SerialPortTestDlg.h : header file
//

#if !defined(AFX_SERIALPORTTESTDLG_H__10BAA9E8_A181_4CEE_89B0_3BC874EFEE76__INCLUDED_)
#define AFX_SERIALPORTTESTDLG_H__10BAA9E8_A181_4CEE_89B0_3BC874EFEE76__INCLUDED_
#define TIMER_EVENT                10    //任意定义的一个计时器的ID号

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

/////////////////////////////////////////////////////////////////////////////
// CSerialPortTestDlg dialog

class CSerialPortTestDlg : public CDialog
{
// Construction
public:
	DCB dcb;
	HANDLE m_hComm;
	HANDLE m_ExitThreadEvent;
	HANDLE hTestControlsThread;
	BOOL ClosePort(void);

	BOOL OpenPort(LPCTSTR Port,int BaudRate,int DataBits,int StopBits,int Parity);
	static DWORD CommRecvTread(LPVOID lparam);
	static DWORD CommTestControlsTread(LPVOID lparam);
	typedef void (CALLBACK * ONCOMMRECV)(CWnd* pWnd,char *buf,int buflen);
	static void CALLBACK OnCommRecv(CWnd* pWnd,char *buf,int buflen);

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

// Dialog Data
	//{{AFX_DATA(CSerialPortTestDlg)
	enum { IDD = IDD_SERIALPORTTEST_DIALOG };
	CButton	m_ButSend;
	CButton	m_ButAutoSend;
	CButton	m_ButStopAutoSend;
	CButton	m_ButTestControls;
	CListBox	m_State;
	CButton	m_ButClose;
	CButton	m_ButOpen;
	CComboBox	m_ComboPort;
	CComboBox	m_ComboBaud;
	CString	m_strSendEdit;
	CString	m_strRecDisp;
	//}}AFX_DATA

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

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CSerialPortTestDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnDestroy();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnOpenPort();
	afx_msg void OnCloseCom();
	afx_msg void OnSend();
	afx_msg void OnClearSend();
	afx_msg void OnClearRec();
	afx_msg void OnStopAutoSend();
	afx_msg void OnTestControls();
	afx_msg void OnAutoSend();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_SERIALPORTTESTDLG_H__10BAA9E8_A181_4CEE_89B0_3BC874EFEE76__INCLUDED_)

⌨️ 快捷键说明

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