1 //####COPYRIGHTBEGIN####
3 // ----------------------------------------------------------------------------
4 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
6 // This program is part of the eCos host tools.
8 // This program is free software; you can redistribute it and/or modify it
9 // under the terms of the GNU General Public License as published by the Free
10 // Software Foundation; either version 2 of the License, or (at your option)
13 // This program is distributed in the hope that it will be useful, but WITHOUT
14 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 // You should have received a copy of the GNU General Public License along with
19 // this program; if not, write to the Free Software Foundation, Inc.,
20 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 // ----------------------------------------------------------------------------
24 //####COPYRIGHTEND####
25 // RunTests.cpp : Defines the class behaviors for the application.
30 #include "CSHDialog.h"
31 #include "eCosDialog.h"
35 #include "RunTestsSheet.h"
36 #include "Properties.h"
41 static char THIS_FILE[] = __FILE__;
44 /////////////////////////////////////////////////////////////////////////////
47 BEGIN_MESSAGE_MAP(CRunTestsApp, CWinApp)
48 //{{AFX_MSG_MAP(CRunTestsApp)
49 // NOTE - the ClassWizard will add and remove mapping macros here.
50 // DO NOT EDIT what you see in these blocks of generated code!
52 //ON_COMMAND(ID_HELP, CWinApp::OnHelp)
55 /////////////////////////////////////////////////////////////////////////////
56 // CRunTestsApp construction
58 CRunTestsApp::CRunTestsApp()
60 // TODO: add construction code here,
61 // Place all significant initialization in InitInstance
64 /////////////////////////////////////////////////////////////////////////////
65 // The one and only CRunTestsApp object
69 /////////////////////////////////////////////////////////////////////////////
70 // CRunTestsApp initialization
72 BOOL CRunTestsApp::InitInstance()
75 CeCosTestPlatform::Load();
77 ::GetModuleFileName(::GetModuleHandle(NULL),strCSHFile.GetBuffer(1+MAX_PATH),MAX_PATH);
78 strCSHFile.ReleaseBuffer();
79 strCSHFile.ReplaceExtension(_T(".chm"));
80 CCSHDialog::SetCSHFilePath(strCSHFile);
82 extern UINT arTestToolDialogMap[];
83 CeCosDialog::AddDialogMap(arTestToolDialogMap);
88 AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
92 AfxEnableControlContainer();
94 // Standard initialization
95 // If you are not using these features and wish to reduce the size
96 // of your final executable, you should remove from the following
97 // the specific initialization routines you do not need.
100 Enable3dControls(); // Call this when using MFC in a shared DLL
102 Enable3dControlsStatic(); // Call this when linking to MFC statically
107 int nResponse = dlg.DoModal();
108 if (nResponse == IDOK)
110 // TODO: Place code here to handle when the dialog is
113 else if (nResponse == IDCANCEL)
115 // TODO: Place code here to handle when the dialog is
116 // dismissed with Cancel
119 CRunTestsSheet sheet(_T("Run Tests"), NULL, 0, InitFunc);
121 //sheet.m_psh.hIcon=LoadIcon(IDR_MAINFRAME);
122 //sheet.m_psh.dwFlags|=PSH_USEHICON/*|PSH_HASHELP*/;
125 // Since the dialog has been closed, return FALSE so that we exit the
126 // application, rather than start the application's message pump.
128 CeCosTestPlatform::RemoveAllPlatforms();
133 void CALLBACK CRunTestsApp::InitFunc(CProperties *pProp, bool bSave)
135 static bool bFirstTime=true;
137 pProp->SaveToRegistry(HKEY_CURRENT_USER,_T("Software\\Red Hat\\eCos\\RunTests"));
139 pProp->LoadFromCommandString(GetCommandLine());
140 pProp->LoadFromRegistry(HKEY_CURRENT_USER,_T("Software\\Red Hat\\eCos\\RunTests"));