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

📄 wzdprtio.h

📁 E:Visual_C__MFC扩展编程实例 实例52:使用串行或并行I/O
💻 H
字号:
// PortIO.h: interface for the CPortIO class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PORTIO_H__81CE0F20_8C16_11D2_A18D_99620BDF6820__INCLUDED_)
#define AFX_PORTIO_H__81CE0F20_8C16_11D2_A18D_99620BDF6820__INCLUDED_

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

#include "WzdQue.h"

// define the send and receive threads
typedef struct t_SENDDATA
{
	CFile *pFile;
	LPSTR lpBuf;
	int len;
} SENDDATA;

typedef struct t_RECVDATA
{
	CFile *pFile;
	int hdrSz;
	int bodyPos;
	CWzdQueue *pQueue;
	CWnd *pWnd;
	UINT msg;
	UINT id;
} RECVDATA;

class CWzdPortIO : public CFile  
{
public:
	CWzdPortIO() {};
	virtual ~CWzdPortIO() {};

	BOOL OpenLPT(int n,CFileException *e=NULL);
	BOOL OpenCOM(int n,CFileException *e=NULL, int baud=-1, int parity=-1,
			int databits=-1, int stopbits=-1);

	void Send(LPSTR lpBuf, int len);
	void Listen(int hdrSz, int bodyPos, CWzdQueue *pQueue, CWnd *pWnd, UINT msg, UINT id);

private:
	SENDDATA m_SendData;
	RECVDATA m_RecvData;


};
UINT SendThread( LPVOID pParam );
UINT RecvThread( LPVOID pParam );

#endif // !defined(AFX_PORTIO_H__81CE0F20_8C16_11D2_A18D_99620BDF6820__INCLUDED_)

⌨️ 快捷键说明

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