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

📄 dlgserial.h

📁 周立功WinCE光盘资料
💻 H
字号:
#if !defined(AFX_DLGSERIAL_H__5160FF8B_8184_4D4D_82E6_9ACA9B7471C1__INCLUDED_)
#define AFX_DLGSERIAL_H__5160FF8B_8184_4D4D_82E6_9ACA9B7471C1__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DLGSERIAL.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// DLGSERIAL dialog

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

// Dialog Data
	//{{AFX_DATA(DLGSERIAL)
	enum { IDD = IDD_DLGSERIAL_DIALOG };
	CComboBox	m_ComboBaud;
	CComboBox	m_ComboData;
	CComboBox	m_ComboPort;
	CComboBox	m_ComboParity;
	CButton	m_ButOpen;
	CButton	m_ButClose;
	CComboBox	m_ComboStop;
	CString	m_strSendEdit;
	//}}AFX_DATA


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

// Implementation
protected:
	// 串口接收数据成功回调函数
	typedef void (CALLBACK *ONCOMMRECV)(CWnd* pWnd, char *buf, int buflen);
	static void CALLBACK OnCommRecv(CWnd* pWnd, char *buf, int buflen);

	BOOL OpenPort(LPCTSTR Port, int BaudRate, int DataBits, int StopBits, int Parity);
	static DWORD CommRecvTread(LPVOID lparam);
	HICON m_hIcon;
	// Generated message map functions
	//{{AFX_MSG(DLGSERIAL)
	afx_msg void OnClearRec();
	afx_msg void OnClearSend();
	afx_msg void OnCloseCom();
	afx_msg void OnDestroy();
	afx_msg void OnOpenCom();
	afx_msg void OnSend();
	virtual BOOL OnInitDialog();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
	DCB dcb;						/* 串口参数结构体 */
	HANDLE m_hComm;					/* 串口操作句柄 */
	HANDLE m_ExitThreadEvent;		/* 串口接收线程退出事件 */
	CString m_strRecDisp;			/* 接收区显示字符 */
	
	BOOL ClosePort(void);

	// 打开串口 

	// 串口接收线程

	// 串口接收数据成功回调函数
	typedef void (CALLBACK *ONCOMMRECV)(CWnd* pWnd, char *buf, int buflen);
private:
};

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

#endif // !defined(AFX_DLGSERIAL_H__5160FF8B_8184_4D4D_82E6_9ACA9B7471C1__INCLUDED_)

⌨️ 快捷键说明

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