1 // ModelingApp.cpp : Defines the class behaviors for the application.
6 #include "..\res\resource.h"
8 #include "ModelingApp.h"
10 #include "OCC_MainFrame.h"
11 #include "OCC_3dChildFrame.h"
12 #include "ModelingDoc.h"
13 #include "OCC_3dView.h"
15 /////////////////////////////////////////////////////////////////////////////
16 // CModelingApp construction
18 CModelingApp::CModelingApp() : OCC_App()
20 SampleName = "Modeling"; //for about dialog
23 /////////////////////////////////////////////////////////////////////////////
24 // The one and only CModelingApp object
28 /////////////////////////////////////////////////////////////////////////////
29 // CModelingApp initialization
31 BOOL CModelingApp::InitInstance()
33 AfxEnableControlContainer();
35 // Standard initialization
36 // If you are not using these features and wish to reduce the size
37 // of your final executable, you should remove from the following
38 // the specific initialization routines you do not need.
40 // Change the registry key under which our settings are stored.
41 // You should modify this string to be something appropriate
42 // such as the name of your company or organization.
43 SetRegistryKey(_T("Local AppWizard-Generated Applications"));
45 LoadStdProfileSettings(); // Load standard INI file options (including MRU)
47 // Register the application's document templates. Document templates
48 // serve as the connection between documents, frame windows and views.
50 CMultiDocTemplate* pDocTemplate;
51 pDocTemplate = new CMultiDocTemplate(
53 RUNTIME_CLASS(CModelingDoc),
54 RUNTIME_CLASS(OCC_3dChildFrame), // custom MDI child frame
55 RUNTIME_CLASS(OCC_3dView));
56 AddDocTemplate(pDocTemplate);
58 // create main MDI Frame window
59 OCC_MainFrame* pMainFrame = new OCC_MainFrame(with_AIS_TB);
60 if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
62 m_pMainWnd = pMainFrame;
63 // Create additional toolbar
64 m_pToolBar2 = new CToolBar;
65 if ( !m_pToolBar2->Create(m_pMainWnd, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_TOOLTIPS) ||
66 !m_pToolBar2->LoadToolBar(IDR_FRAME2))
68 TRACE0("Failed to create toolbar\n");
73 // Parse command line for standard shell commands, DDE, file open
74 CCommandLineInfo cmdInfo;
75 ParseCommandLine(cmdInfo);
77 // Dispatch commands specified on the command line
78 if (!ProcessShellCommand(cmdInfo))
81 // The main window has been initialized, so show and update it.
82 pMainFrame->ShowWindow(m_nCmdShow);
83 pMainFrame->UpdateWindow();