⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 asview.cpp

📁 《VC++ 编程技巧与示例 .rar》各个示例代码绝对可用
💻 CPP
字号:
// ASView.cpp : implementation of the CASView class
//

#include "stdafx.h"
#include "AS.h"

#include "ASDoc.h"
#include "ASView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CASView

IMPLEMENT_DYNCREATE(CASView, CView)

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

/////////////////////////////////////////////////////////////////////////////
// CASView construction/destruction

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

}

CASView::~CASView()
{
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CASView drawing

void CASView::OnDraw(CDC* pDC)
{
	CASDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
//●:
	CString str;
	str.Format("The Larger Number is :%f",pDoc->m_LargerNumber);
	pDC->TextOut(10,10,str);
}

/////////////////////////////////////////////////////////////////////////////
// CASView printing

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CASView diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CASView message handlers
//●:
void CASView::OnInitialUpdate() 
{
	CView::OnInitialUpdate();
	
	// TODO: Add your specialized code here and/or call the base class
	CASDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	pDoc->m_LargerNumber=1234567654321;
}

⌨️ 快捷键说明

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