/*****************************************************************************
* Copyright (c) 2000 Digi International Inc., All Rights Reserved
* 
* This software contains proprietary and confidential information of Digi
* International Inc.  By accepting transfer of this copy, Recipient agrees
* to retain this software in confidence, to prevent disclosure to others, 
* and to make no use of this software other than that for which it was
* delivered.  This is an unpublished copyrighted work of Digi International
* Inc.  Except as permitted by federal law, 17 USC 117, copying is strictly
* prohibited.
* 
* Restricted Rights Legend
*
* Use, duplication, or disclosure by the Government is subject to
* restrictions set forth in sub-paragraph (c)(1)(ii) of The Rights in
* Technical Data and Computer Software clause at DFARS 252.227-7031 or
* subparagraphs (c)(1) and (2) of the Commercial Computer Software -
* Restricted Rights at 48 CFR 52.227-19, as applicable.
*
* Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
*
*****************************************************************************/

// CustomApp.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "CustomApp.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CCustomAppApp

BEGIN_MESSAGE_MAP(CCustomAppApp, CWinApp)
	//{{AFX_MSG_MAP(CCustomAppApp)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCustomAppApp construction

CCustomAppApp::CCustomAppApp()
{
   // TODO: add construction code here,
	// Place all significant initialization in InitInstance
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CCustomAppApp object

CCustomAppApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CCustomAppApp initialization

BOOL CCustomAppApp::InitInstance()
{

#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif

   // Shared data init
   m_fUpdatedAdapter = FALSE; // Set if existing adapter was updated...
   m_fUpdatedDriver = FALSE;  // Set if driver and INFs were copied over...

   // Instantiate all of the property pages
   CPropPageWelcome PropPageWelcome;
   CPropPageOldDriver PropPageOldDriver;
   CPropPageDevMgrRunning PropPageDevMgrRunning;
   CPropPageUpdateAdapter PropPageUpdateAdapter;
   CPropPageUpdateDriver PropPageUpdateDriver;
   CPropPageFinished PropPageFinished;

   CBitmap bmpWatermark;
	CBitmap bmpHeader;
   bmpWatermark.LoadBitmap(IDB_BITMAP_BIG_DIGI_LOGO);
	bmpHeader.LoadBitmap(IDB_BITMAP_SMALL_DIGI_LOGO);

   // Prop sheet setup, Wizard style
   CPropertySheetEx Sheet( IDS_SHEET_TITLE,NULL,0,bmpWatermark,NULL,bmpHeader);
   m_pMainWnd = &Sheet;
   Sheet.m_psh.dwFlags |= PSH_WIZARD97;
   Sheet.m_psh.hInstance = ::GetModuleHandle(NULL);

   // Add all of the property pages, we will skip if any are unused
   Sheet.AddPage(&PropPageWelcome);
   Sheet.AddPage(&PropPageOldDriver);
   Sheet.AddPage(&PropPageDevMgrRunning);
   Sheet.AddPage(&PropPageUpdateAdapter);
   Sheet.AddPage(&PropPageUpdateDriver);
   Sheet.AddPage(&PropPageFinished);

	INT_PTR nResponse =  Sheet.DoModal();
	if (nResponse == IDOK)
	{
		// Currently, there is nothing to do, the pages have handled it all
	}
	else if (nResponse == IDCANCEL)
	{
		// Currently, there is nothing to do, the pages have handled it all
	}

   // Since the wizard is done, return FALSE so that we exit the application
   return FALSE;
}
