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

📄 dlgrs485.h

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

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

/////////////////////////////////////////////////////////////////////////////
// DLGRS485 dialog

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

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


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

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(DLGRS485)
	afx_msg void OnOpenCom();
	afx_msg void OnCloseCom();
	afx_msg void OnSend();
	afx_msg void OnClearSend();
	afx_msg void OnClearRec();
	virtual BOOL OnInitDialog();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

	DCB dcb;						/* 串口参数结构体 */
	HANDLE m_hComm;					/* 串口操作句柄 */
	HANDLE m_ExitThreadEvent;		/* 串口接收线程退出事件 */
	CString m_strRecDisp;			/* 接收区显示字符 */
	// 串口接收数据成功回调函数
	typedef void (CALLBACK *ONCOMMRECV)(CWnd* pWnd, char *buf, int buflen);
	static void CALLBACK OnCommRecv(CWnd* pWnd, char *buf, int buflen);
private:

		// 串口接收线程
	static DWORD CommRecvTread(LPVOID lparam);
	BOOL ClosePort(void);
	BOOL OpenPort(LPCTSTR Port, int BaudRate, int DataBits, int StopBits, int Parity);
};

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

#endif // !defined(AFX_DLGRS485_H__ECAB3131_C12E_4DB9_8046_3A8E0F9E223C__INCLUDED_)

⌨️ 快捷键说明

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