//////////////////////////////////////////////////////////////////////
// CPUPGuiApp.cpp: implementation of the CPUPGuiApp class.
//
//////////////////////////////////////////////////////////////////////
#include <conio.h>
#include "pupguiapp.h"
#include "stdafx.h"

//////////////////////////////////////////////////////////////////////
BEGIN_MESSAGE_MAP(CPUPGuiApp, CWinApp)	
	//{{AFX_MSG_MAP(CPUPGuiApp)
	//}}AFX_MSG_MAP
	ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()

//////////////////////////////////////////////////////////////////////
CPUPGuiApp::CPUPGuiApp()
{
}
CPUPGuiApp::~CPUPGuiApp()
{
	if(_pDlg!= NULL)
		delete _pDlg;
}
CPUPGuiApp::ExitInstance()
{
	return TRUE;
}

int CPUPGuiApp::initialize()
{
	int ret;

	if((ret = GenoApp::initialize()) != -1)
	{
		if(_pDlg != NULL)
			_pDlg->StartTimers();
	}	
	return ret;
}
BOOL CPUPGuiApp::InitInstance()
{
	AfxEnableControlContainer();	

#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif

	_pDlg = new CGenoAppDlg(NULL, this);		
	
	_pDlg->Create(IDD_GENO_DIALOG);	

	m_pMainWnd = _pDlg;

	_pDlg->ShowWindow(SW_SHOW);

	MicroApp::run();

	return TRUE;
}

int CPUPGuiApp::exit()
{		
	int r;

	r = GenoApp::exit();

	_pDlg->DestroyWindow();
	

	::exit(0);

	return r;
}
