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

📄 datasvrview.cpp

📁 一个串口通信的程序
💻 CPP
字号:
// DataSvrView.cpp : implementation of the CDataSvrView class
//

#include "stdafx.h"
#include "DataSvr.h"

#include "DataSvrDoc.h"
#include "DataSvrView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDataSvrView

IMPLEMENT_DYNCREATE(CDataSvrView, CView)

BEGIN_MESSAGE_MAP(CDataSvrView, CView)
	//{{AFX_MSG_MAP(CDataSvrView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDataSvrView construction/destruction

CDataSvrView::CDataSvrView()
{
	// TODO: add construction code here

}

CDataSvrView::~CDataSvrView()
{
}

BOOL CDataSvrView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CDataSvrView drawing

void CDataSvrView::OnDraw(CDC* pDC)
{
	CDataSvrDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
/*
	CBrush oldbrush;
	CDC m_pdcMemory;
	CRect rect;
	this->GetClientRect(&rect);
	m_pdcMemory.CreateCompatibleDC(pDC);	
//	m_pBitmap->CreateCompatibleBitmappDC,rect.right+1,rect.bottom+1); pdcMemory->SelectObject(m_pBitmap);		
	oldbrush=m_pdcMemory.SelectObject(GRAY_BRUSH);
	m_pdcMemory.Rectangle(0,0,rect.right,rect.bottom);
	m_pdcMemory.SelectStockObject(NULL_BRUSH);
*/
}

/////////////////////////////////////////////////////////////////////////////
// CDataSvrView printing

BOOL CDataSvrView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CDataSvrView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CDataSvrView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CDataSvrView diagnostics

#ifdef _DEBUG
void CDataSvrView::AssertValid() const
{
	CView::AssertValid();
}

void CDataSvrView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CDataSvrDoc* CDataSvrView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CDataSvrDoc)));
	return (CDataSvrDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CDataSvrView message handlers

⌨️ 快捷键说明

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