【VC开源代码栏目提醒】:网学会员在VC开源代码频道为大家收集整理了CModalView.cpp提供大家参考,希望对大家有所帮助!
// CModalView.cpp : implementation of the CCModalView class
//
#include "stdafx.h"
#include "CModal.h"
#include "CModalDoc.h"
#include "CModalView.h"
#include"Modaldlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCModalView
IMPLEMENT_DYNCREATE(CCModalView, CView)
BEGIN_MESSAGE_MAP(CCModalView, CView)
//{{AFX_MSG_MAP(CCModalView)
ON_COMMAND(IDM_DIALOG, OnDialog)
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CCModalView construction/destruction
CCModalView::CCModalView()
{
// TODO: add construction code here
}
CCModalView::~CCModalView()
{
}
BOOL CCModalView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CCModalView drawing
void CCModalView::OnDraw(CDC* pDC)
{
CCModalDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CCModalView printing
BOOL CCModalView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CCModalView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CCModalView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CCModalView diagnostics
#ifdef _DEBUG
void CCModalView::AssertValid() const
{
CView::AssertValid();
}
void CCModalView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CCModalDoc* CCModalView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCModalDoc)));
return (CCModalDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CCModalView message handlers
void CCModalView::OnDialog()
{
// TODO: Add your command handler code here
Modaldlg dlg;
dlg.DoModal();
}
上一篇:
CModalDoc.cpp
下一篇:
阿尔茨海默病和血管性痴呆患者血脂代谢异常的研究