mfcprintdemodoc.cpp

来自「Visual_C++[1].NET_Bible1 Visual_C++宝典书中」· C++ 代码 · 共 86 行

CPP
86
字号
// MFCPrintDemoDoc.cpp : implementation of the CMFCPrintDemoDoc class
//

#include "stdafx.h"
#include "MFCPrintDemo.h"

#include "MFCPrintDemoDoc.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CMFCPrintDemoDoc

IMPLEMENT_DYNCREATE(CMFCPrintDemoDoc, CDocument)

BEGIN_MESSAGE_MAP(CMFCPrintDemoDoc, CDocument)
END_MESSAGE_MAP()


// CMFCPrintDemoDoc construction/destruction

CMFCPrintDemoDoc::CMFCPrintDemoDoc()
{
	// TODO: add one-time construction code here

}

CMFCPrintDemoDoc::~CMFCPrintDemoDoc()
{
}

BOOL CMFCPrintDemoDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

  // archer
  m_data.Add(_T("The Aeneid by Virgil"));
  m_data.Add(_T("===================="));
  m_data.Add(_T("Of arms I sing and of the man who first"));
  m_data.Add(_T("from Trojan shores beneath the ban of fate"));
  m_data.Add(_T("To Italy and coasts Lavanian came"));
  m_data.Add(_T("Much tossed about on land and ocean"));
  m_data.Add(_T("He by violence of the Gods above"));
  m_data.Add(_T("to sate relentless Juno's ever-rankling ire"));

	return TRUE;
}




// CMFCPrintDemoDoc serialization

void CMFCPrintDemoDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
}


// CMFCPrintDemoDoc diagnostics

#ifdef _DEBUG
void CMFCPrintDemoDoc::AssertValid() const
{
	CDocument::AssertValid();
}

void CMFCPrintDemoDoc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG


// CMFCPrintDemoDoc commands

⌨️ 快捷键说明

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