scannerctl.h

来自「一个扫描枪串口通讯程序」· C头文件 代码 · 共 89 行

H
89
字号
#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 + =
减小字号Ctrl + -
显示快捷键?