1 // MainFrm.cpp : implementation of the CMainFrame class
12 static char THIS_FILE[] = __FILE__;
15 /////////////////////////////////////////////////////////////////////////////
18 IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
20 BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
21 //{{AFX_MSG_MAP(CMainFrame)
22 // NOTE - the ClassWizard will add and remove mapping macros here.
23 // DO NOT EDIT what you see in these blocks of generated code !
28 static UINT indicators[] =
30 ID_SEPARATOR, // status line indicator
36 /////////////////////////////////////////////////////////////////////////////
37 // CMainFrame construction/destruction
39 CMainFrame::CMainFrame()
41 // TODO: add member initialization code here
45 CMainFrame::~CMainFrame()
49 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
51 if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
54 if (!m_wndToolBar.Create(this) ||
55 !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
57 TRACE0("Failed to create toolbar\n");
58 return -1; // fail to create
61 if (!m_wndStatusBar.Create(this) ||
62 !m_wndStatusBar.SetIndicators(indicators,
63 sizeof(indicators)/sizeof(UINT)))
65 TRACE0("Failed to create status bar\n");
66 return -1; // fail to create
69 // TODO: Remove this if you don't want tool tips or a resizeable toolbar
70 m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
71 CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
73 // TODO: Delete these three lines if you don't want the toolbar to
75 m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
76 EnableDocking(CBRS_ALIGN_ANY);
77 DockControlBar(&m_wndToolBar);
82 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
84 // TODO: Modify the Window class or styles here by modifying
85 // the CREATESTRUCT cs
87 return CMDIFrameWnd::PreCreateWindow(cs);
90 /////////////////////////////////////////////////////////////////////////////
91 // CMainFrame diagnostics
94 void CMainFrame::AssertValid() const
96 CMDIFrameWnd::AssertValid();
99 void CMainFrame::Dump(CDumpContext& dc) const
101 CMDIFrameWnd::Dump(dc);
106 /////////////////////////////////////////////////////////////////////////////
107 // CMainFrame message handlers