《MFC对话框打印预览实现》.docVIP

  • 9
  • 0
  • 约2.17万字
  • 约 18页
  • 2016-02-28 发布于河南
  • 举报
《MFC对话框打印预览实现》.doc

MFC对话框打印预览实现 1.创建MFC对话框工程,选择在共享库中调用。 2.添加文件: MainFrm.h, MyPreviewView.h, WrapperView.h, MainFrm.cpp, WrapperView.cpp 分别为: MainFrm.h 1 // MainFrm.h : interface of the CMainFrame class 2 // 3 ///////////////////////////////////////////////////////////////////////////// 4 5 #if !defined(AFX_MAINFRM_H__5C3F89A6_932E_11D3_8420_FC56F1C91E86__INCLUDED_) 6 #define AFX_MAINFRM_H__5C3F89A6_932E_11D3_8420_FC56F1C91E86__INCLUDED_ 7 8 #if _MSC_VER 1000 9 #pragma once 10 #endif // _MSC_VER 1000 11 #include wrapperview.h 12 13 class CMainFrame : public CFrameWnd 14 { 15 public: 16 CMainFrame(DRAWFUN pDraw,CWnd*pOldW,CWnd* pCallW,BOOL bDirect,LPCTSTR stTitle=NULL); 17 CWnd* pOldWnd; 18 CWnd* pCallWnd; 19 DRAWFUN Draw; 20 BOOL bDirectPrint; 21 protected: 22 DECLARE_DYNAMIC(CMainFrame) 23 public: 24 // Overrides 25 // ClassWizard generated virtual function overrides 26 //{{AFX_VIRTUAL(CMainFrame) 27 virtual BOOL PreCreateWindow(CREATESTRUCT cs); 28 virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo); 29 //}}AFX_VIRTUAL 30 // Implementation 31 public: 32 virtual ~CMainFrame(); 33 #ifdef _DEBUG 34 virtual void AssertValid() const; 35 virtual void Dump(CDumpContext dc) const; 36 #endif 37 38 protected: // control bar embedded members 39 CStatusBar m_wndStatusBar; 40 CToolBar m_wndToolBar; 41 CWrapperView *m_pView; 42 43 // Generated message map functions 44 protected: 45 //{{AFX_MSG(CMainFrame) 46 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 47 //}}AFX_MSG 48 DECLARE_MESSAGE_MAP() 49 public: 50 afx_msg void OnClose(); 51 }; 52 ///////////////////////////////////////////////////////////////////////////// 53 //{{AFX_INSERT_LOCATION}} 54 // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 55 #endif // !defined(AFX_MAINFRM_H__5C3F89A6_932E_11D3_8420_FC56F1C91E86__INCL

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档