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

📄 comm.h

📁 RS232串口与SOCKET通信转换程序
💻 H
字号:
// Comm.h: interface for the Comm class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_COMM_H__17961BD5_A023_11D4_BF22_0000E8E4C832__INCLUDED_)
#define AFX_COMM_H__17961BD5_A023_11D4_BF22_0000E8E4C832__INCLUDED_

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

typedef struct _CommSet
{
	HANDLE hComm;
	bool Connected;
	HWND m_hWindow;
	DWORD ThreadID;
	char smode;
} CommSet,*LPCommSet;

class Comm  
{
//Attributes
public:
	HANDLE comv;
    char ComName[5]; // the communication name

//Operation
public:
	int speed;
	Comm(CWnd *p);
	virtual ~Comm();
    BOOL initcomport(); // initial the serial port
    BOOL SendString(char *p,int length); // send the string directly
	LPBYTE GetCommMSRShadow();
private:
	//For CommWatchProc thread
	CommSet commset;
	CWinThread* hCommWatchThread;
	HANDLE hCommThread;
	OVERLAPPED ComOverlapped;
friend	UINT CommWatchProc(LPVOID pParam1);

};

#endif // !defined(AFX_COMM_H__17961BD5_A023_11D4_BF22_0000E8E4C832__INCLUDED_)

⌨️ 快捷键说明

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