《深入浅出MFC第2版(PDF格式)》第288章


#0089 // CMainFrame diagnostics 
#0090 
881 
…………………………………………………………Page 944……………………………………………………………
第五篇 附錄
#0091 #ifdef _DEBUG 
#0092 void CMainFrame::AssertValid() const 
#0093 { 
#0094 CMDIFrameWnd::AssertValid(); 
#0095 } 
#0096 
#0097 void CMainFrame::Dump(CDumpContext& dc) const 
#0098 { 
#0099 CMDIFrameWnd::Dump(dc); 
#0100 } 
#0101 
#0102 #endif //_DEBUG 
#0103 
#0104 ///////////////////////////////////////////////////////////////// 
#0105 // CMainFrame message handlers 
CHILDFRM。H 
#0001 class CChildFrame : public CMDIChildWnd 
#0002 { 
#0003 DECLARE_DYNCREATE(CChildFrame) 
#0004 public: 
#0005 CChildFrame(); 
#0006 
#0007 // Attributes 
#0008 protected: 
#0009 CSplitterWnd m_wndSplitter; 
#0010 public: 
#0011 
#0012 // Operations 
#0013 public: 
#0014 
#0015 // Overrides 
#0016 // ClassWizard generated virtual function overrides 
#0017 //{{AFX_VIRTUAL(CChildFrame) 
#0018 public: 
#0019 virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 
#0020 protected: 
#0021 virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs; CCreateContext* pContext); 
#0022 //}}AFX_VIRTUAL 
#0023 
#0024 // Implementation 
#0025 public: 
#0026 virtual ~CChildFrame(); 
#0027 #ifdef _DEBUG 
#0028 virtual void AssertValid() const; 
882 
…………………………………………………………Page 945……………………………………………………………
附錄B Scribble Step5 完整原始碼 
#0029 virtual void Dump(CDumpContext& dc) const; 
#0030 #endif 
#0031 
#0032 // Generated message map functions 
#0033 protected: 
#0034 //{{AFX_MSG(CChildFrame) 
#0035 // NOTE the ClassWizard will add and remove member functions here。 
#0036 // DO NOT EDIT what you see in these blocks of generated code! 
#0037 //}}AFX_MSG 
#0038 DECLARE_MESSAGE_MAP() 
#0039 }; 
CHILDFRM。CPP 
#0001 #include 〃stdafx。h〃 
#0002 #include 〃Scribble。h〃 
#0003 
#0004 #include 〃ChildFrm。h〃 
#0005 
#0006 #ifdef _DEBUG 
#0007 #define new DEBUG_NEW 
#0008 #undef THIS_FILE 
#0009 static char THIS_FILE'' = __FILE__; 
#0010 #endif 
#0011 
#0012 ///////////////////////////////////////////////////////////////// 
#0013 // CChildFrame 
#0014 
#0015 IMPLEMENT_DYNCREATE(CChildFrame; CMDIChildWnd) 
#0016 
#0017 BEGIN_MESSAGE_MAP(CChildFrame; CMDIChildWnd) 
#0018 //{{AFX_MSG_MAP(CChildFrame) 
#0019 // NOTE the ClassWizard will add and remove mapping macros here。 
#0020 // DO NOT EDIT what you see in these blocks of generated code ! 
#0021 //}}AFX_MSG_MAP 
#0022 END_MESSAGE_MAP() 
#0023 
#0024 //////////////////////////////////////////////////////////////// 
#0025 // CChildFrame construction/destruction 
#0026 
#0027 CChildFrame::CChildFrame() 
#0028 { 
#0029 // TODO: add member initialization code here 
#0030 
#0031 } 
#0032 
883 
…………………………………………………………Page 946……………………………………………………………
第五篇 附錄
#0033 CChildFrame::~CChildFrame() 
#0034 { 
#0035 } 
#0036 
#0037 BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs) 
#0038 { 
#0039 // TODO: Modify the Window class or styles here by modifying 
#0040 // the CREATESTRUCT cs 
#0041 
#0042 return CMDIChildWnd::PreCreateWindow(cs); 
#0043 } 
#0044 
#0045 ///////////////////////////////////////////////////////////////// 
#0046 // CChildFrame diagnostics 
#0047 
#0048 #ifdef _DEBUG 
#0049 void CChildFrame::AssertValid() const 
#0050 { 
#0051 CMDIChildWnd::AssertValid(); 
#0052 } 
#0053 
#0054 void CChildFrame::Dump(CDumpContext& dc) const 
#0055 { 
#0056 CMDIChildWnd::Dump(dc); 
#0057 } 
#0058 
#0059 #endif //_DEBUG 
#0060 
#0061 //////////////////////////////////////////////////////////////// 
#0062 // CChildFrame message handlers 
#0063 
#0064 BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT /* lpcs */; 
CCreateContext* pContext) 
#0065 { 
小说推荐
返回首页返回目录