helloworld1view.cpp

来自「Visual C++编程宝典随书光盘里的代码」· C++ 代码 · 共 77 行

CPP
77
字号
// HelloWorld1View.cpp : implementation of the CHelloWorld1View class
//

#include "stdafx.h"
#include "HelloWorld1.h"

#include "HelloWorld1Doc.h"
#include "HelloWorld1View.h"

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

/////////////////////////////////////////////////////////////////////////////
// CHelloWorld1View

IMPLEMENT_DYNCREATE(CHelloWorld1View, CView)

BEGIN_MESSAGE_MAP(CHelloWorld1View, CView)
	//{{AFX_MSG_MAP(CHelloWorld1View)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CHelloWorld1View construction/destruction

CHelloWorld1View::CHelloWorld1View()
{
}

CHelloWorld1View::~CHelloWorld1View()
{
}

BOOL CHelloWorld1View::PreCreateWindow(CREATESTRUCT& cs)
{
	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CHelloWorld1View drawing

void CHelloWorld1View::OnDraw(CDC* pDC)
{
	CHelloWorld1Doc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);

	pDC->TextOut( 20,20, "Hello Visual C++ World!" );

}

/////////////////////////////////////////////////////////////////////////////
// CHelloWorld1View diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CHelloWorld1View message handlers

⌨️ 快捷键说明

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