1 // MainFrm.cpp : implementation of the CMainFrame class
12 static char THIS_FILE
[] = __FILE__
;
15 /////////////////////////////////////////////////////////////////////////////
18 IMPLEMENT_DYNCREATE(CMainFrame
, CFrameWnd
)
20 BEGIN_MESSAGE_MAP(CMainFrame
, CFrameWnd
)
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
44 CMainFrame::~CMainFrame()
48 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct
)
50 if (CFrameWnd::OnCreate(lpCreateStruct
) == -1)
53 if (!m_wndToolBar
.CreateEx(this, TBSTYLE_FLAT
, WS_CHILD
| WS_VISIBLE
|
54 CBRS_TOP
| CBRS_GRIPPER
| CBRS_TOOLTIPS
|
55 CBRS_FLYBY
| CBRS_SIZE_DYNAMIC
) ||
56 !m_wndToolBar
.LoadToolBar(IDR_MAINFRAME
))
58 TRACE0("Failed to create toolbar\n");
59 return -1; // fail to create
62 if (!m_wndStatusBar
.Create(this) ||
63 !m_wndStatusBar
.SetIndicators(indicators
,
64 sizeof(indicators
)/sizeof(UINT
)))
66 TRACE0("Failed to create status bar\n");
67 return -1; // fail to create
70 // TODO: Delete these three lines if you don't want the toolbar to
72 m_wndToolBar
.EnableDocking(CBRS_ALIGN_ANY
);
73 EnableDocking(CBRS_ALIGN_ANY
);
74 DockControlBar(&m_wndToolBar
);
79 BOOL
CMainFrame::PreCreateWindow(CREATESTRUCT
& cs
)
81 if( !CFrameWnd::PreCreateWindow(cs
) )
83 // TODO: Modify the Window class or styles here by modifying
84 // the CREATESTRUCT cs
89 /////////////////////////////////////////////////////////////////////////////
90 // CMainFrame diagnostics
93 void CMainFrame::AssertValid() const
95 CFrameWnd::AssertValid();
98 void CMainFrame::Dump(CDumpContext
& dc
) const
105 /////////////////////////////////////////////////////////////////////////////
106 // CMainFrame message handlers