// hello_mfcView.cpp : implementation of the CHello_mfcView class
//

#include "stdafx.h"
#include "hello_mfc.h"

#include "hello_mfcDoc.h"
#include "hello_mfcView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CHello_mfcView

IMPLEMENT_DYNCREATE(CHello_mfcView, CView)

BEGIN_MESSAGE_MAP(CHello_mfcView, CView)
	//{{AFX_MSG_MAP(CHello_mfcView)
		// 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()

/////////////////////////////////////////////////////////////////////////////
// CHello_mfcView construction/destruction

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

}

CHello_mfcView::~CHello_mfcView()
{
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CHello_mfcView drawing

void CHello_mfcView::OnDraw(CDC* pDC)
{
	CHello_mfcDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	
	// PN: Display Hello World in the main window
	pDC->TextOut( 0, 0, "Hello world" );
}

/////////////////////////////////////////////////////////////////////////////
// CHello_mfcView printing

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CHello_mfcView diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CHello_mfcView message handlers
