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

📄 serialportdlg.h

📁 调用WinAPI函数进行串口通信
💻 H
字号:
// SerialPortDlg.h : header file
//

#if !defined(AFX_SERIALPORTDLG_H__13A28C37_A197_4CD5_ACC0_B829898FA5C3__INCLUDED_)
#define AFX_SERIALPORTDLG_H__13A28C37_A197_4CD5_ACC0_B829898FA5C3__INCLUDED_

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

#include "SetupDlg.h"

/////////////////////////////////////////////////////////////////////////////
// CSerialPortDlg dialog
#define MAXBLOCK 2048
#define XON 0x11
#define XOFF 0x13
UINT SPCommProc(LPVOID pParam);

class CSerialPortDlg : public CDialog
{
// Construction
public:
	DWORD WriteComm(char *buf,DWORD dwLength);
	DWORD ReadComm(char *buf,DWORD dwLength);
	BOOL ConfigConnection();
	CSerialPortDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	CWinThread *m_pThread;
	volatile BOOL m_bConnected;
	volatile HANDLE m_hSPCom;
	OVERLAPPED m_osRead,m_osWrite;
	int m_nBaud,m_nDataBits,m_nFlowCtrl;
	CString m_sPort,m_sParity,m_sStopBits;
	//{{AFX_DATA(CSerialPortDlg)
	enum { IDD = IDD_SERIALPORT_DIALOG };
	CString	m_sSendMsg;
	CString	m_sShow;
	//}}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 OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnSpConnect();
	afx_msg void OnSpDisconnect();
	virtual void OnCancel();
	afx_msg void OnSpSettings();
	afx_msg void OnSpSend();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_SERIALPORTDLG_H__13A28C37_A197_4CD5_ACC0_B829898FA5C3__INCLUDED_)

⌨️ 快捷键说明

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