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

📄 scannerctl.h

📁 一个扫描枪串口通讯程序
💻 H
字号:
#include "SerialPort.h"

#if !defined(AFX_SCANNERCTL_H__D69F736E_EDF3_4ACC_AB51_C9887C94A341__INCLUDED_)
#define AFX_SCANNERCTL_H__D69F736E_EDF3_4ACC_AB51_C9887C94A341__INCLUDED_

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

// ScannerCtl.h : Declaration of the CScannerCtrl ActiveX Control class.

/////////////////////////////////////////////////////////////////////////////
// CScannerCtrl : See ScannerCtl.cpp for implementation.

class CScannerCtrl : public COleControl
{
	DECLARE_DYNCREATE(CScannerCtrl)

// Constructor
public:
	CScannerCtrl();
	short m_nBaud;       //波特率
	short m_nCom;         //串口号
	char m_cParity;    //校验
	short m_nDatabits;    //数据位
	short m_nStopbits;    //停止位
    CSerialPort m_Port;

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CScannerCtrl)
	public:
	virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
	virtual void DoPropExchange(CPropExchange* pPX);
	virtual void OnResetState();
	//}}AFX_VIRTUAL

// Implementation
protected:
	DWORD m_dwCommEvents;
	~CScannerCtrl();

	DECLARE_OLECREATE_EX(CScannerCtrl)    // Class factory and guid
	DECLARE_OLETYPELIB(CScannerCtrl)      // GetTypeInfo
	DECLARE_PROPPAGEIDS(CScannerCtrl)     // Property page IDs
	DECLARE_OLECTLTYPE(CScannerCtrl)		// Type name and misc status

// Message maps
	//{{AFX_MSG(CScannerCtrl)
		// NOTE - ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

// Dispatch maps
	//{{AFX_DISPATCH(CScannerCtrl)
	afx_msg short OpenserialAndWaittingfordata();
	afx_msg void CloseSerialAndStopreceivedata();
	afx_msg void OnCommunication(short ch_receiving);
	//}}AFX_DISPATCH
	DECLARE_DISPATCH_MAP()

	afx_msg void AboutBox();

// Event maps
	//{{AFX_EVENT(CScannerCtrl)
	void FireChariscoming(short charname)
		{FireEvent(eventidChariscoming,EVENT_PARAM(VTS_I2), charname);}
	//}}AFX_EVENT
	DECLARE_EVENT_MAP()

// Dispatch and event IDs
public:
	enum {
	//{{AFX_DISP_ID(CScannerCtrl)
	dispidOpenserialAndWaittingfordata = 1L,
	dispidCloseSerialAndStopreceivedata = 2L,
	dispidOnCommunication = 3L,
	eventidChariscoming = 1L,
	//}}AFX_DISP_ID
	};

};

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

#endif // !defined(AFX_SCANNERCTL_H__D69F736E_EDF3_4ACC_AB51_C9887C94A341__INCLUDED)

⌨️ 快捷键说明

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