//
//  Copyright © 2002, RESON Inc. All Rights Reserved.
//
//  No part of this file may be reproduced or transmitted in any form or by
//  any means, electronic or mechanical, including photocopy, recording, or
//  information storage or retrieval system, without permission in writing
//  from RESON Inc.
//
//  Filename:   6046Hasp.cpp
//
//  Project:    6046
//
//  Author(s):  W. Arcus.
//
//  Purpose:    
//              
//
//  Notes:      
//

#include "StdAfx.h"
#include "6046Hasp.h"
#include "6046HaspDlg.h"
#include "PassWordDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// C6046HaspApp

BEGIN_MESSAGE_MAP(C6046HaspApp, CWinApp)
	//{{AFX_MSG_MAP(C6046HaspApp)
	//}}AFX_MSG
	ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// C6046HaspApp construction

C6046HaspApp::C6046HaspApp( void )
{
}

/////////////////////////////////////////////////////////////////////////////
// The one and only C6046HaspApp object

C6046HaspApp theApp;

/////////////////////////////////////////////////////////////////////////////
// C6046HaspApp initialization

BOOL C6046HaspApp::InitInstance( void )
{
	AfxEnableControlContainer();

	// Standard initialization

#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif

    CPassWordDlg PassWordDlg;

    if ( PassWordDlg.DoModal() == IDOK )
    {
        if ( PassWordDlg.IsValid() )
        {
	        CMy6046HaspDlg Dlg;

	        m_pMainWnd = &Dlg;
            Dlg.DoModal();
        }
        else
        {
            ::AfxMessageBox( _T( "Password is invalid\nProgram will terminate !" ), MB_OK | MB_ICONSTOP );
        }
    }

	return FALSE;       // Return false so that app is exited and the message pump is not started.
}
