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

📄 ex11view.cpp

📁 vc++例子 学习过程中制作 对话框 按纽 编程实例
💻 CPP
字号:
// Ex11View.cpp : implementation of the CEx11View class
//

#include "stdafx.h"
#include "Ex11.h"

#include "Ex11Doc.h"
#include "Ex11View.h"

#include "Diacomctrl.h"

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

/////////////////////////////////////////////////////////////////////////////
// CEx11View

IMPLEMENT_DYNCREATE(CEx11View, CView)

BEGIN_MESSAGE_MAP(CEx11View, CView)
	//{{AFX_MSG_MAP(CEx11View)
	ON_COMMAND(ID_COMTRLTEST, OnComtrltest)
	//}}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()

/////////////////////////////////////////////////////////////////////////////
// CEx11View construction/destruction

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

}

CEx11View::~CEx11View()
{
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CEx11View drawing

void CEx11View::OnDraw(CDC* pDC)
{
	CEx11Doc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CEx11View printing

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CEx11View diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CEx11View message handlers

void CEx11View::OnComtrltest() 
{
	CDiacomctrl dlg;
	dlg.DoModal();
	// TODO: Add your command handler code here
	
}

⌨️ 快捷键说明

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