1 // ChildFrm.cpp : implementation of the CChildFrame class
5 #include "GeometryApp.h"
9 /////////////////////////////////////////////////////////////////////////////
12 IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
14 BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
15 //{{AFX_MSG_MAP(CChildFrame)
20 /////////////////////////////////////////////////////////////////////////////
21 // CChildFrame construction/destruction
23 CChildFrame::CChildFrame()
25 // TODO: add member initialization code here
29 CChildFrame::~CChildFrame()
33 /////////////////////////////////////////////////////////////////////////////
34 // CChildFrame diagnostics
37 void CChildFrame::AssertValid() const
39 CMDIChildWnd::AssertValid();
42 void CChildFrame::Dump(CDumpContext& dc) const
44 CMDIChildWnd::Dump(dc);
49 void CChildFrame::ActivateFrame(int nCmdShow)
51 // TODO: Add your specialized code here and/or call the base class
53 static BOOL first=true;
56 CMDIChildWnd::ActivateFrame(SW_SHOWMAXIMIZED);
60 POSITION pos=AfxGetApp()->GetFirstDocTemplatePosition();
61 CDocTemplate* DocT=AfxGetApp()->GetNextDocTemplate(pos);
62 POSITION p=DocT->GetFirstDocPosition();
65 nCmdShow = SW_SHOWMAXIMIZED;
67 CMDIChildWnd::ActivateFrame(nCmdShow);
70 int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
72 if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
75 if (!m_wndToolBar.Create(this) || !m_wndToolBar.LoadToolBar(IDR_3dCHILDFRAME))
77 TRACE0("Failed to create toolbar\n");
78 return -1; // fail to create
81 m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
82 m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
83 EnableDocking(CBRS_ALIGN_ANY);
84 DockControlBar(&m_wndToolBar);
89 BOOL CChildFrame::DestroyWindow()
91 // TODO: Add your specialized code here and/or call the base class
93 return CMDIChildWnd::DestroyWindow();