// 2DSelectionApp.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"

#include "2DSelectionApp.h"

#include "OCC_MainFrame.h"
#include "OCC_2dChildFrame.h"
#include "2DSelectionDoc.h"
#include <OCC_2dView.h>

/////////////////////////////////////////////////////////////////////////////
// C2DSelectionApp construction

C2DSelectionApp::C2DSelectionApp()
{
	SampleName = "2DSelection";		//for about dialog
}

/////////////////////////////////////////////////////////////////////////////
// The one and only C2DSelectionApp object

C2DSelectionApp theApp;

/////////////////////////////////////////////////////////////////////////////
// C2DSelectionApp initialization

BOOL C2DSelectionApp::InitInstance()
{
	// Standard initialization
	// If you are not using these features and wish to reduce the size
	//  of your final executable, you should remove from the following
	//  the specific initialization routines you do not need.

	LoadStdProfileSettings();  // Load standard INI file options (including MRU)

	// Register the application's document templates.  Document templates
	//  serve as the connection between documents, frame windows and views.

	CMultiDocTemplate* pDocTemplate;
	pDocTemplate = new CMultiDocTemplate(
		IDR_2DTYPE,
		RUNTIME_CLASS(C2DSelectionDoc),
		RUNTIME_CLASS(OCC_2dChildFrame), // custom MDI child frame
		RUNTIME_CLASS(OCC_2dView));
	AddDocTemplate(pDocTemplate);

	// create main MDI Frame window
	OCC_MainFrame* pMainFrame = new OCC_MainFrame;
	if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
		return FALSE;
	m_pMainWnd = pMainFrame;

	// Parse command line for standard shell commands, DDE, file open
	CCommandLineInfo cmdInfo;
	ParseCommandLine(cmdInfo);

	// Dispatch commands specified on the command line
	if (!ProcessShellCommand(cmdInfo))
		return FALSE;

	// The main window has been initialized, so show and update it.
	pMainFrame->ShowWindow(m_nCmdShow);
	pMainFrame->UpdateWindow();

	return TRUE;
}

