1 // Viewer2dApp.cpp : Defines the class behaviors for the application.
6 #include "Viewer2dApp.h"
8 #include "OCC_MainFrame.h"
9 #include "OCC_2dChildFrame.h"
10 #include "Viewer2dDoc.h"
11 #include "OCC_2dView.h"
16 static char THIS_FILE[] = __FILE__;
19 /////////////////////////////////////////////////////////////////////////////
20 // CViewer2dApp construction
22 CViewer2dApp::CViewer2dApp() : OCC_App()
24 SampleName = "Viewer2d"; //for about dialog
25 SetSamplePath ("..\\..\\03_Viewer2d");
28 /////////////////////////////////////////////////////////////////////////////
29 // The one and only CViewer2dApp object
33 /////////////////////////////////////////////////////////////////////////////
34 // CViewer2dApp initialization
36 BOOL CViewer2dApp::InitInstance()
38 // Standard initialization
39 // If you are not using these features and wish to reduce the size
40 // of your final executable, you should remove from the following
41 // the specific initialization routines you do not need.
43 LoadStdProfileSettings(); // Load standard INI file options (including MRU)
45 // Register the application's document templates. Document templates
46 // serve as the connection between documents, frame windows and views.
48 CMultiDocTemplate* pDocTemplate;
49 pDocTemplate = new CMultiDocTemplate(
51 RUNTIME_CLASS(CViewer2dDoc),
52 RUNTIME_CLASS(OCC_2dChildFrame),
53 RUNTIME_CLASS(OCC_2dView));
54 AddDocTemplate(pDocTemplate);
56 // create main MDI Frame window
57 OCC_MainFrame* pMainFrame = new OCC_MainFrame;
58 if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
60 m_pMainWnd = pMainFrame;
62 // Parse command line for standard shell commands, DDE, file open
63 CCommandLineInfo cmdInfo;
64 ParseCommandLine(cmdInfo);
66 // Dispatch commands specified on the command line
67 if (!ProcessShellCommand(cmdInfo))
70 // The main window has been initialized, so show and update it.
71 pMainFrame->ShowWindow(m_nCmdShow);
72 pMainFrame->UpdateWindow();