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