ex44View.cpp
资源名称:VC6.0.rar [点击查看]
上传用户:qdhmjx
上传日期:2022-07-11
资源大小:2226k
文件大小:2k
源码类别:
书籍源码
开发平台:
Visual C++
- // ex44View.cpp : implementation of the CEx44View class
- //
- #include "stdafx.h"
- #include "ex44.h"
- #include "ex44Doc.h"
- #include "ex44View.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CEx44View
- IMPLEMENT_DYNCREATE(CEx44View, CView)
- BEGIN_MESSAGE_MAP(CEx44View, CView)
- //{{AFX_MSG_MAP(CEx44View)
- // 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()
- /////////////////////////////////////////////////////////////////////////////
- // CEx44View construction/destruction
- CEx44View::CEx44View()
- {
- // TODO: add construction code here
- }
- CEx44View::~CEx44View()
- {
- }
- BOOL CEx44View::PreCreateWindow(CREATESTRUCT& cs)
- {
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
- return CView::PreCreateWindow(cs);
- }
- /////////////////////////////////////////////////////////////////////////////
- // CEx44View drawing
- void CEx44View::OnDraw(CDC* pDC)
- {
- CEx44Doc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
- pDC->TextOut(30,30,"Hello,World! This is a MFC Application.");
- }
- /////////////////////////////////////////////////////////////////////////////
- // CEx44View printing
- BOOL CEx44View::OnPreparePrinting(CPrintInfo* pInfo)
- {
- // default preparation
- return DoPreparePrinting(pInfo);
- }
- void CEx44View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add extra initialization before printing
- }
- void CEx44View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add cleanup after printing
- }
- /////////////////////////////////////////////////////////////////////////////
- // CEx44View diagnostics
- #ifdef _DEBUG
- void CEx44View::AssertValid() const
- {
- CView::AssertValid();
- }
- void CEx44View::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
- CEx44Doc* CEx44View::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEx44Doc)));
- return (CEx44Doc*)m_pDocument;
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CEx44View message handlers