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

📄 winceserialdlg.h

📁 WINCE6下写的一个串口通讯程序
💻 H
字号:
// WinCESerialDlg.h : header file
//

#pragma once
#include "afxwin.h"

DWORD WINAPI ReadPortThread(LPVOID lpvoid);             // 读数据线程

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

// Dialog Data
	enum { IDD = IDD_WINCESERIAL_DIALOG };

public:
	HANDLE hReadThread;
	BOOL m_bConnected;

	BOOL InitCommTimeouts();                            // 设置超时参数
	BOOL InitDCB();                                     // 配置串口
	BOOL ClosePort(HANDLE hCommPort);                   // 关闭串口
	DWORD WritePort(TCHAR *buf, DWORD dwBytesToWrite);  // 写数据
	BOOL OpenPort(LPTSTR lpszPortName);                 // 打开串口

protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
#if defined(_DEVICE_RESOLUTION_AWARE) && !defined(WIN32_PLATFORM_WFSP)
	afx_msg void OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/);
#endif
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedButtonSerialOpen();
	afx_msg void OnBnClickedButtonSerialWrite();
	afx_msg void OnBnClickedButtonSerialClose();
	CEdit m_ceReadSerial;
	CEdit m_ceSendserial;
	int m_iport;
	CString m_com1state;
	CString m_com2state;
	afx_msg void OnButtonStatus();
	afx_msg void OnBnClickedButtonCleanData();
};

⌨️ 快捷键说明

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