📄 xgpscomctl.h
字号:
#if !defined(AFX_XGPSCOMCTL_H__0776B4D5_41D0_448F_B4F8_84D6B6170683__INCLUDED_)
#define AFX_XGPSCOMCTL_H__0776B4D5_41D0_448F_B4F8_84D6B6170683__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// XGpscomCtl.h : Declaration of the CXGpscomCtrl ActiveX Control class.
/////////////////////////////////////////////////////////////////////////////
// CXGpscomCtrl : See XGpscomCtl.cpp for implementation.
class CXGpscomCtrl : public COleControl
{
DECLARE_DYNCREATE(CXGpscomCtrl)
// Constructor
public:
CXGpscomCtrl();
HANDLE hCom;//串口句柄
OVERLAPPED m_osRead,m_osWrite;
short ComName;//0为COM 1为COM2 2为COM3 3为COM4
long xBaudRate;//率nNewValue 默认为9600
BOOL xfParity;//奇偶校验 默认为开
short xByteSize;//数据位数 默认为8位
short xParity;//EVENPARITY 偶校验 默认为偶校验
//NOPARITY 无校验
//ODDPARITY 奇校验
long xStopBits;//停止位 默认为1位
//ONESTOPBIT 1位停止位
//ONE%STOPBITS 1.5位停止位
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CXGpscomCtrl)
public:
virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
virtual void DoPropExchange(CPropExchange* pPX);
virtual void OnResetState();
//}}AFX_VIRTUAL
// Implementation
protected:
~CXGpscomCtrl();
DECLARE_OLECREATE_EX(CXGpscomCtrl) // Class factory and guid
DECLARE_OLETYPELIB(CXGpscomCtrl) // GetTypeInfo
DECLARE_PROPPAGEIDS(CXGpscomCtrl) // Property page IDs
DECLARE_OLECTLTYPE(CXGpscomCtrl) // Type name and misc status
// Message maps
//{{AFX_MSG(CXGpscomCtrl)
// 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(CXGpscomCtrl)
afx_msg short GetXComName();
afx_msg void SetXComName(short nNewValue);//设置启用哪一个串口 默认为COM1
//nNewValue=0为COM1
//nNewValue=1为COM2
//nNewValue=2为COM3
//nNewValue=3为COM4
afx_msg BOOL GetXfParity();
afx_msg void SetXfParity(BOOL bNewValue);//真为允许奇偶校验 默认为开
afx_msg short GetByteSize();
afx_msg void SetByteSize(short nNewValue);//数据位数 默认为8位
afx_msg short GetXParity();
afx_msg void SetXParity(short nNewValue);//EVENPARITY 偶校验 默认为偶校验
//NOPARITY 无校验
//ODDPARITY 奇校验
afx_msg short GetXStopBits();
afx_msg void SetXStopBits(short nNewValue);//停止位 默认为1位
//ONESTOPBIT 1位停止位
//ONE%STOPBITS 1.5位停止位
afx_msg long GetXBaudRate();
afx_msg void SetXBaudRate(long nNewValue);//设置波特率nNewValue 默认为9600
afx_msg BOOL setupcom();//初始化串口
afx_msg BOOL setsystime();//杭州GPS对时
afx_msg BOOL TD2000();//山东GPS对时
//}}AFX_DISPATCH
DECLARE_DISPATCH_MAP()
afx_msg void AboutBox();
// Event maps
//{{AFX_EVENT(CXGpscomCtrl)
//}}AFX_EVENT
DECLARE_EVENT_MAP()
// Dispatch and event IDs
public:
enum {
//{{AFX_DISP_ID(CXGpscomCtrl)
dispidXComName = 1L,
dispidXfParity = 2L,
dispidByteSize = 3L,
dispidXParity = 4L,
dispidXStopBits = 5L,
dispidXBaudRate = 6L,
dispidSetupcom = 7L,
dispidSetsystime = 8L,
dispidTD2000 = 9L,
//}}AFX_DISP_ID
};
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_XGPSCOMCTL_H__0776B4D5_41D0_448F_B4F8_84D6B6170683__INCLUDED)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -