ex72View.cpp
资源名称:VC6.0.rar [点击查看]
上传用户:qdhmjx
上传日期:2022-07-11
资源大小:2226k
文件大小:4k
源码类别:
书籍源码
开发平台:
Visual C++
- // ex72View.cpp : implementation of the CEx72View class
- //
- #include "stdafx.h"
- #include "ex72.h"
- #include "ex72Doc.h"
- #include "ex72View.h"
- #include "MyPropertySheet.h"
- #include "MyWizardSheet.h"
- CMyWizardSheet* m_pWizardSheet;//全局指针变量
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CEx72View
- IMPLEMENT_DYNCREATE(CEx72View, CView)
- BEGIN_MESSAGE_MAP(CEx72View, CView)
- //{{AFX_MSG_MAP(CEx72View)
- ON_COMMAND(ID_SheetDlg, OnSheetDlg)
- ON_COMMAND(ID_WizardDlg, OnWizardDlg)
- //}}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()
- /////////////////////////////////////////////////////////////////////////////
- // CEx72View construction/destruction
- CEx72View::CEx72View()
- {
- // TODO: add construction code here
- }
- CEx72View::~CEx72View()
- {
- }
- BOOL CEx72View::PreCreateWindow(CREATESTRUCT& cs)
- {
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
- return CView::PreCreateWindow(cs);
- }
- /////////////////////////////////////////////////////////////////////////////
- // CEx72View drawing
- void CEx72View::OnDraw(CDC* pDC)
- {
- CEx72Doc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
- // TODO: add draw code for native data here
- }
- /////////////////////////////////////////////////////////////////////////////
- // CEx72View printing
- BOOL CEx72View::OnPreparePrinting(CPrintInfo* pInfo)
- {
- // default preparation
- return DoPreparePrinting(pInfo);
- }
- void CEx72View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add extra initialization before printing
- }
- void CEx72View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add cleanup after printing
- }
- /////////////////////////////////////////////////////////////////////////////
- // CEx72View diagnostics
- #ifdef _DEBUG
- void CEx72View::AssertValid() const
- {
- CView::AssertValid();
- }
- void CEx72View::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
- CEx72Doc* CEx72View::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEx72Doc)));
- return (CEx72Doc*)m_pDocument;
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CEx72View message handlers
- void CEx72View::OnProperties()
- {
- // TODO: The property sheet attached to your project
- // via this function is not hooked up to any message
- // handler. In order to actually use the property sheet,
- // you will need to associate this function with a control
- // in your project such as a menu item or tool bar button.
- CMyPropertySheet propSheet;
- propSheet.DoModal();
- // This is where you would retrieve information from the property
- // sheet if propSheet.DoModal() returned IDOK. We aren't doing
- // anything for simplicity.
- }
- void CEx72View::OnSheetDlg()
- {
- OnProperties();
- }
- void CEx72View::OnWizard()
- {
- // TODO: The property sheet attached to your project
- // via this function is not hooked up to any message
- // handler. In order to actually use the property sheet,
- // you will need to associate this function with a control
- // in your project such as a menu item or tool bar button.
- m_pWizardSheet=new CMyWizardSheet; //动态分配空间初始化指针
- m_pWizardSheet->DoModal(); //显示向导对话框
- delete m_pWizardSheet; //释放空间
- // This is where you would retrieve information from the property
- // sheet if propSheet.DoModal() returned IDOK. We aren't doing
- // anything for simplicity.
- }
- void CEx72View::OnWizardDlg()
- {
- OnWizard(); //调用OnWizard函数,显示向导对话框
- }