vc05bview.cpp

来自「Visual C++ 6.0编程基础与范例」· C++ 代码 · 共 137 行

CPP
137
字号
// vc05bView.cpp : implementation of the CVc05bView class
//

#include "stdafx.h"
#include "vc05b.h"

#include "vc05bDoc.h"
#include "vc05bView.h"
#include "vc05bDialog.h"

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

/////////////////////////////////////////////////////////////////////////////
// CVc05bView

IMPLEMENT_DYNCREATE(CVc05bView, CView)

BEGIN_MESSAGE_MAP(CVc05bView, CView)
	//{{AFX_MSG_MAP(CVc05bView)
	ON_COMMAND(ID_MENUITEM32771, OnMenuitem32771)
	ON_COMMAND(ID_MENUITEM32772, OnMenuitem32772)
	ON_COMMAND(ID_MENUITEM32773, OnMenuitem32773)
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_MESSAGE(IDEND,OnEnd)
	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()

/////////////////////////////////////////////////////////////////////////////
// CVc05bView construction/destruction

CVc05bView::CVc05bView()
{
	// TODO: add construction code here
	m_pd=new CVc05bDialog(this);
}

CVc05bView::~CVc05bView()
{
	delete m_pd;
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CVc05bView drawing

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

/////////////////////////////////////////////////////////////////////////////
// CVc05bView printing

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CVc05bView diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CVc05bView message handlers

void CVc05bView::OnMenuitem32771() 
{
	// TODO: Add your command handler code here
	if(m_pd->GetSafeHwnd() == 0)
	{
		m_pd->Creat();
	}
}

void CVc05bView::OnMenuitem32772() 
{
	// TODO: Add your command handler code here
	m_pd->DestroyWindow();
}

void CVc05bView::OnMenuitem32773() 
{
	// TODO: Add your command handler code here
	CVc05bDialog md;
	int a2=md.DoModal();
}

LONG CVc05bView::OnEnd()
{
	m_pd->DestroyWindow();
	return 0L;
}

⌨️ 快捷键说明

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