wzdprtio.h

来自「MFC扩展编程实例」· C头文件 代码 · 共 56 行

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