recvview.h

来自「一个VC++编写的串口通信程序」· C头文件 代码 · 共 79 行

H
79
字号
#if !defined(AFX_RECVVIEW_H__D18485E3_155B_495F_85EA_42753A3AE639__INCLUDED_)
#define AFX_RECVVIEW_H__D18485E3_155B_495F_85EA_42753A3AE639__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// RecvView.h : header file
//
#include "ComDbgDoc.h"
#define BPB		5
#define BPL		64
#define RBUF	2048		//recv buf
#define LBUF	(BPB*BPL+1)	//line buf
#define TBUF	(64*1024)	//text buf
/////////////////////////////////////////////////////////////////////////////
// CRecvView view
class CRecvView : public CEditView
{
protected:
	CRecvView();           // protected constructor used by dynamic creation
	DECLARE_DYNCREATE(CRecvView)

// Attributes
public:
	CComDbgDoc* GetDocument();
	CComDbgDoc*	m_pDoc;
	CEdit*		m_pedt;
	CEvent		m_evnStop;
	HANDLE		m_hThread;
	int			m_nbpl;		//每行字符数
	char		m_szl[LBUF];
	char*		m_ptext;
	CFont		m_font;
// Operations
public:
	static	DWORD WINAPI	RecvThread(LPVOID	lpParam);
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CRecvView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnInitialUpdate();
	//}}AFX_VIRTUAL

// Implementation
public:
	void Recv();
	BOOL StartRecv();
	void StopRecv();
	void Clear();
	virtual ~CRecvView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CRecvView)
	afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in SendView.cpp
inline CComDbgDoc* CRecvView::GetDocument()
   { return (CComDbgDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_RECVVIEW_H__D18485E3_155B_495F_85EA_42753A3AE639__INCLUDED_)

⌨️ 快捷键说明

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