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

📄 abcview.cpp

📁 这是书上的代码
💻 CPP
字号:
// abcView.cpp : implementation of the CAbcView class
//

#include "stdafx.h"
#include "abc.h"

#include "abcDoc.h"
#include "abcView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CAbcView

IMPLEMENT_DYNCREATE(CAbcView, CView)

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

/////////////////////////////////////////////////////////////////////////////
// CAbcView construction/destruction

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

}

CAbcView::~CAbcView()
{
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CAbcView drawing

void CAbcView::OnDraw(CDC* pDC)
{
	CAbcDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
	pDC->TextOut(200,300, "这是第一显示器,本测试程序的副显示器应设在主显示器的右边");
	pDC->TextOut(1100,300,"这是第二显示器, 对双显示器的控制已经成功!");

}


/////////////////////////////////////////////////////////////////////////////
// CAbcView printing

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CAbcView diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CAbcView message handlers

⌨️ 快捷键说明

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