【VC开源代码栏目提醒】:网学会员VC开源代码为您提供Ex06_1View.cpp参考,解决您在Ex06_1View.cpp学习中工作中的难题,参考学习。
// Ex06_1View.cpp : implementation of the CEx06_1View class
//
#include "stdafx.h"
#include "Ex06_1.h"
#include "Ex06_1Doc.h"
#include "Ex06_1View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CEx06_1View
IMPLEMENT_DYNCREATE(CEx06_1View, CView)
BEGIN_MESSAGE_MAP(CEx06_1View, CView)
//{{AFX_MSG_MAP(CEx06_1View)
ON_COMMAND(ID_MESSAGEBOX_EXCLAMATION, OnMessageboxExclamation)
ON_COMMAND(ID_MESSAGE_INFORMATION, OnMessageInformation)
ON_COMMAND(ID_MESSAGEBOX_QUESTION, OnMessageboxQuestion)
ON_COMMAND(ID_MESSAGEBOX_STOP, OnMessageboxStop)
ON_COMMAND(ID_MESSAGEBOX_DEFAULT, OnMessageboxDefault)
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CEx06_1View construction/destruction
CEx06_1View::CEx06_1View()
{
// TODO: add construction code here
}
CEx06_1View::~CEx06_1View()
{
}
BOOL CEx06_1View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CEx06_1View drawing
void CEx06_1View::OnDraw(CDC* pDC)
{
CEx06_1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CEx06_1View printing
BOOL CEx06_1View::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CEx06_1View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CEx06_1View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CEx06_1View diagnostics
#ifdef _DEBUG
void CEx06_1View::AssertValid() const
{
CView::AssertValid();
}
void CEx06_1View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CEx06_1Doc* CEx06_1View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEx06_1Doc)));
return (CEx06_1Doc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CEx06_1View message handlers
void CEx06_1View::OnMessageboxExclamation()
{
// TODO: Add your command handler code here
AfxMessageBox("警告",MB_OKCANCEL|MB_ICONEXCLAMATION);
}
void CEx06_1View::OnMessageInformation()
{
// TODO: Add your command handler code here
AfxMessageBox("信息", MB_OKCANCEL|MB_ICONINFORMATION);
}
void CEx06_1View::OnMessageboxQuestion()
{
// TODO: Add your command handler code here
AfxMessageBox("
问题", MB_ABORTRETRYIGNORE|MB_ICONQUESTION);
}
void CEx06_1View::OnMessageboxStop()
{
// TODO: Add your command handler code here
AfxMessageBox("错误!", MB_OK|MB_ICONSTOP);
}
void CEx06_1View::OnMessageboxDefault()
{
// TODO: Add your command handler code here
AfxMessageBox("缺省");
}