显示红色的那句错了,大家帮看看啊。谢谢了
// chap3View.cpp : implementation of the CChap3View class//
#include "stdafx.h"
#include "chap3.h"
#include "chap3Doc.h"
#include "chap3View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChap3View
IMPLEMENT_DYNCREATE(CChap3View, CView)
BEGIN_MESSAGE_MAP(CChap3View, CView)
//{{AFX_MSG_MAP(CChap3View)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CChap3View construction/destruction
CChap3View::CChap3View()
{
// TODO: add construction code here
}
CChap3View::~CChap3View()
{
}
BOOL CChap3View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CChap3View drawing
void CChap3View::OnDraw(CDC* pDC)
{
pDC-->TextOut(30,30,"Hello World!");
CChap3Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CChap3View printing
BOOL CChap3View::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CChap3View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CChap3View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CChap3View diagnostics
#ifdef _DEBUG
void CChap3View::AssertValid() const
{
CView::AssertValid();
}
void CChap3View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CChap3Doc* CChap3View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CChap3Doc)));
return (CChap3Doc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CChap3View message handlers