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 /////////////////////////////////////////////////////////////////////////////
29 // CMainFrame construction/destruction
31 CMainFrame::CMainFrame()
33 // TODO: add member initialization code here
37 CMainFrame::~CMainFrame()
41 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
43 if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
46 if (!m_wndToolBar.CreateEx(this) ||
47 !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
49 TRACE0("Failed to create toolbar\n");
50 return -1; // fail to create
52 if (!m_wndDlgBar.Create(this, IDR_MAINFRAME,
53 CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR))
55 TRACE0("Failed to create dialogbar\n");
56 return -1; // fail to create
59 if (!m_wndReBar.Create(this) ||
60 !m_wndReBar.AddBar(&m_wndToolBar) ||
61 !m_wndReBar.AddBar(&m_wndDlgBar))
63 TRACE0("Failed to create rebar\n");
64 return -1; // fail to create
67 // TODO: Remove this if you don't want tool tips
68 m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
69 CBRS_TOOLTIPS | CBRS_FLYBY);
74 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
76 if( !CFrameWnd::PreCreateWindow(cs) )
78 // TODO: Modify the Window class or styles here by modifying
79 // the CREATESTRUCT cs
81 cs.style = WS_OVERLAPPED | WS_CAPTION | FWS_ADDTOTITLE
82 | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
87 /////////////////////////////////////////////////////////////////////////////
88 // CMainFrame diagnostics
91 void CMainFrame::AssertValid() const
93 CFrameWnd::AssertValid();
96 void CMainFrame::Dump(CDumpContext& dc) const
103 /////////////////////////////////////////////////////////////////////////////
104 // CMainFrame message handlers