📄 comaccess.h
字号:
// ComAccess.h: interface for the CComAccess class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_COMACCESS_H__F15FFC6E_D059_4E57_97CD_A672C05FF9B7__INCLUDED_)
#define AFX_COMACCESS_H__F15FFC6E_D059_4E57_97CD_A672C05FF9B7__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CComAccess
{
private:
HANDLE m_hCom; // Device handle
OVERLAPPED m_ov; // A structure that contains informations which are
// used for asynchronous input and output operations
TCHAR m_lpszErrorMessage[256];
public:
CComAccess();
CComAccess(LPCSTR lpszPortNum);
~CComAccess();
// For more definitions see <winbase.h>
BOOL Open(LPCSTR lpszPortNum = "com1",
DWORD dwBaudRate = CBR_9600,
BYTE byParity = NOPARITY,
BYTE byStopBits = ONESTOPBIT,
BYTE byByteSize = 8);
VOID Close();
DWORD WriteData(LPCVOID pdata, DWORD len);
DWORD ReadData(LPVOID pdest, DWORD len, DWORD dwMaxWait = 500);
LPSTR GetErrorMessage(VOID) { return m_lpszErrorMessage; }
private:
VOID ErrorToString(LPCSTR lpszMessage);
BOOL IsNT(VOID);
};
#endif // !defined(AFX_COMACCESS_H__F15FFC6E_D059_4E57_97CD_A672C05FF9B7__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -