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

📄 serialportdlg.h

📁 evc写的wince下的串口通信
💻 H
字号:
// SerialPortDlg.h : header file
//

#if !defined(AFX_SERIALPORTDLG_H__52641353_2219_4292_8B66_04268A353CEF__INCLUDED_)
#define AFX_SERIALPORTDLG_H__52641353_2219_4292_8B66_04268A353CEF__INCLUDED_

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

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

/////////////////////////////////////////////////////////////////////////////
// CSerialPortDlg dialog

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


	BOOL OpenPort(); //打开串口
	BOOL ClosePort(); //关闭串口
	HANDLE hReadThread;
	DWORD WritePort(); //写数据
	DWORD WriteFileToPort(LPCTSTR FileName);//发送文件
	BOOL SaveReceivedToFile(LPCTSTR FileName);//保存接收区到文件

	BOOL Open;
	BOOL Receive;
	int PortNo,BaudRate,DataBits,StopBits,Parity;
	CString PortID,PortIDs[9];
	int BaudRates[8];	
	DCB dcb;

	UINT m_timer;
	
	DWORD dwThreadID;
	COMMTIMEOUTS CommTimeOuts;

// Dialog Data
	//{{AFX_DATA(CSerialPortDlg)
	enum { IDD = IDD_SERIALPORT_DIALOG };
	CEdit	m_CtrlReceive;
	CString	m_strReceive;
	CString	m_strTransmit;
	//}}AFX_DATA

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

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CSerialPortDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSetup();
	afx_msg void OnOpen();
	afx_msg void OnClearRece();
	afx_msg void OnClearSend();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnRece();
	afx_msg void OnSend();
	afx_msg void OnDestroy();
	afx_msg void OnCheckHex();
	afx_msg void OnSendFile();
	afx_msg void OnSaveReceived();
	afx_msg void OnCheckHexSend();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_SERIALPORTDLG_H__52641353_2219_4292_8B66_04268A353CEF__INCLUDED_)

⌨️ 快捷键说明

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