按键盘上方向键 ← 或 → 可快速上下翻页,按键盘上的 Enter 键可回到本书目录页,按键盘上方向键 ↑ 可回到本页顶部!
————未阅读完?加入书签已便下次继续阅读!
#0019
#0020 BEGIN_MESSAGE_MAP(CMainFrame; CMDIFrameWnd)
#0021 //{{AFX_MSG_MAP(CMainFrame)
#0022 // NOTE the ClassWizard will add and remove mapping macros here。
#0023 // DO NOT EDIT what you see in these blocks of generated code !
#0024 ON_WM_CREATE()
#0025 //}}AFX_MSG_MAP
#0026 END_MESSAGE_MAP()
#0027
#0028 static UINT indicators'' =
#0029 {
#0030 ID_SEPARATOR; // status line indicator
#0031 ID_INDICATOR_CAPS;
#0032 ID_INDICATOR_NUM;
#0033 ID_INDICATOR_SCRL;
280
…………………………………………………………Page 343……………………………………………………………
第4章 Visual C++ 整合性軟體開發環境
#0034 };
#0035
#0036 /////////////////////////////////////////////////////////////////
#0037 // CMainFrame construction/destruction
#0038
#0039 CMainFrame::CMainFrame()
#0040 {
#0041 // TODO: add member initialization code here
#0042
#0043 }
#0044
#0045 CMainFrame::~CMainFrame()
#0046 {
#0047 }
#0048
#0049 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
#0050 {
#0051 if (CMDIFrameWnd::OnCreate(lpCreateStruct) == …1)
#0052 return …1;
#0053
#0054 if (!m_wndToolBar。Create(this) ||
#0055 !m_wndToolBar。LoadToolBar(IDR_MAINFRAME))
#0056 {
#0057 TRACE0(〃Failed to create toolbarn〃);
#0058 return …1; // fail to create
#0059 }
#0060
#0061 if (!m_wndStatusBar。Create(this) ||
#0062 !m_wndStatusBar。SetIndicators(indicators;
#0063 sizeof(indicators)/sizeof(UINT)))
#0064 {
#0065 TRACE0(〃Failed to create status barn〃);
#0066 return …1; // fail to create
#0067 }
#0068
#0069 // TODO: Remove this if you don't want tool tips or a resizeable toolbar
#0070 m_wndToolBar。SetBarStyle(m_wndToolBar。GetBarStyle() |
#0071 CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
#0072
#0073 // TODO: Delete these three lines if you don't want the toolbar to
#0074 // be dockable
#0075 m_wndToolBar。EnableDocking(CBRS_ALIGN_ANY);
#0076 EnableDocking(CBRS_ALIGN_ANY);
#0077 DockControlBar(&m_wndToolBar);
#0078
#0079 return 0;
281
…………………………………………………………Page 344……………………………………………………………
第篇 欲善工事先利其器
#0080 }
#0081
#0082 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
#0083 {
#0084 // TODO: Modify the Window class or styles here by modifying
#0085 // the CREATESTRUCT cs
#0086
#0087 return CMDIFrameWnd::PreCreateWindow(cs);
#0088 }
#0089
#0090 /////////////////////////////////////////////////////////////////
#0091 // CMainFrame diagnostics
#0092
#0093 #ifdef _DEBUG
#0094 void CMainFrame::AssertValid() const
#0095 {
#0096 CMDIFrameWnd::AssertValid();
#0097 }
#0098
#0099 void CMainFrame::Dump(CDumpContext& dc) const
#0100 {
#0101 CMDIFrameWnd::Dump(dc);
#0102 }
#0103
#0104 #endif //_DEBUG
#0105
#0106 /////////////////////////////////////////////////////////////////
#0107 // CMainFrame message handlers
CHILDFRM。CPP
#0001 // ChildFrm。cpp : implementation of the CChildFrame class
#0002 //
#0003
#0004 #include 〃stdafx。h〃
#0005 #include 〃Scribble。h〃
#0006
#0007 #include 〃ChildFrm。h〃
#0008
#0009 #ifdef _DEBUG
#0010 #define new DEBUG_NEW
#0011 #undef THIS_FILE
#0012 static char THIS_FILE'' = __FILE__;
#0013 #endif
#0014
#0015 /////////////////////////////////////////////////////////////////
282
…………………………………………………………Page 345……………………………………………………………
第4章 Visual C++ 整合性軟體開發環境
#0016 // CChildFrame
#0017
#0018 IMPLEMENT_DYNCREATE(CChildFrame; CMDIChildWnd)
#0019
#0020 BEGIN_MESSAGE_MAP(CChildFrame; CMDIChildWnd)
#0021 //{{AFX_MSG_MAP(CChildFrame)
#0022 // NOTE the ClassWizard will add and remove mapping macros here。
#0023 // DO NOT EDIT what you see in these blocks of generated code !
#0024 //}}AFX_MSG_MAP
#0025 END_MESSAGE_MAP()
#0026
#0027 /////////////////////////////////////////////////////////////////
#0028 // CChildFrame construction/destruction
#0029
#0030 CChildFrame::CChildFrame()
#0031 {
#0032 // TODO: add member initialization code here
#0033
#0034 }
#0035
#0036 CChildFrame::~CChildFrame()
#0037 {
#0038 }
#0039
#0040 BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
#0041 {
#0042 // TODO: Modify the Window class or styles here by modifying
#0043 // the CREATESTRUCT cs
#0044
#0045 return CMDIChildWnd::PreCreateWindow(cs);
#0046 }
#0047
#0048 ////////////////////////