TestEgr 15b1 : migliorie varie per aggiornamento visualizzazione.
This commit is contained in:
+69
-18
@@ -15,12 +15,35 @@
|
||||
#include "stdafx.h"
|
||||
#include "TestEGr.h"
|
||||
#include "TestEGrDlg.h"
|
||||
#include "/EgtDev/Include/EGnDllMain.h"
|
||||
#include "/EgtDev/Include/EgnGetModuleVer.h"
|
||||
#include "/EgtDev/Include/EGnStringConverter.h"
|
||||
#include "/EgtDev/Include/EgtIniFile.h"
|
||||
#include "/EgtDev/Include/EgtLogger.h"
|
||||
#include <fstream>
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
||||
//--------------------------- Define -----------------------------------------
|
||||
#if defined( _WIN64)
|
||||
#if defined( NDEBUG)
|
||||
#define STR_EXE "TestEGrR64.exe"
|
||||
#else
|
||||
#define STR_EXE "TestEGrD64.exe"
|
||||
#endif
|
||||
#elif defined( _WIN32)
|
||||
#if defined( NDEBUG)
|
||||
#define STR_EXE "TestEGrR32.exe"
|
||||
#else
|
||||
#define STR_EXE "TestEGrD32.exe"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
using namespace std ;
|
||||
using namespace egtlogger ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// The one and only CTestEGrApp object
|
||||
@@ -34,21 +57,15 @@ END_MESSAGE_MAP()
|
||||
//----------------------------------------------------------------------------
|
||||
CTestEGrApp::CTestEGrApp( void)
|
||||
{
|
||||
// TODO: add construction code here,
|
||||
// Place all significant initialization in InitInstance
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
BOOL
|
||||
CTestEGrApp::InitInstance( void)
|
||||
{
|
||||
// InitCommonControlsEx() is required on Windows XP if an application
|
||||
// manifest specifies use of ComCtl32.dll version 6 or later to enable
|
||||
// visual styles. Otherwise, any window creation will fail.
|
||||
// CommonControls initialize
|
||||
INITCOMMONCONTROLSEX InitCtrls ;
|
||||
InitCtrls.dwSize = sizeof( InitCtrls) ;
|
||||
// Set this to include all the common control classes you want to use
|
||||
// in your application.
|
||||
InitCtrls.dwICC = ICC_WIN95_CLASSES ;
|
||||
InitCommonControlsEx( &InitCtrls) ;
|
||||
|
||||
@@ -56,20 +73,54 @@ CTestEGrApp::InitInstance( void)
|
||||
|
||||
AfxEnableControlContainer() ;
|
||||
|
||||
// recupero il direttorio del programma e lo imposto come corrente
|
||||
string sDir ;
|
||||
GetModuleDirectory( NULL, sDir) ;
|
||||
SetCurrentDirectory( sDir) ;
|
||||
// costruisco path file INI
|
||||
string sFileIni= sDir + "\\TestEGr.ini" ;
|
||||
wchar_t* p = _wcsdup( stringtoW( sFileIni)) ;
|
||||
free( (void*) m_pszProfileName) ;
|
||||
m_pszProfileName = p ;
|
||||
|
||||
// livello di debug
|
||||
int nDebug = GetPrivateProfileInt( "General", "Debug", 0, m_pszProfileName) ;
|
||||
|
||||
// inizializzazioni del logger
|
||||
Logger logger( ( nDebug > 0 ? LL_DEBUG : LL_INFO), "TestEGr") ;
|
||||
logger.AddOutputStream( new ofstream( "TestEgr.log"), true) ;
|
||||
|
||||
// inizio programma
|
||||
LOG_DATETIME( &logger, " Start")
|
||||
|
||||
// versione del programma
|
||||
LOG_INFO( &logger, GetExeNameVer().c_str())
|
||||
|
||||
// versione delle librerie
|
||||
LOG_INFO( &logger, GetEGnVersion())
|
||||
//LOG_INFO( &logger, GetENkVersion())
|
||||
//LOG_INFO( &logger, GetEGkVersion())
|
||||
|
||||
// Dialog interface
|
||||
CTestEGrDlg dlg ;
|
||||
m_pMainWnd = &dlg ;
|
||||
INT_PTR nResponse = dlg.DoModal() ;
|
||||
if ( nResponse == IDOK) {
|
||||
// TODO: Place code here to handle when the dialog is
|
||||
// dismissed with OK
|
||||
}
|
||||
else if ( nResponse == IDCANCEL) {
|
||||
// TODO: Place code here to handle when the dialog is
|
||||
// dismissed with Cancel
|
||||
}
|
||||
dlg.DoModal() ;
|
||||
|
||||
// Since the dialog has been closed, return FALSE so that we exit the
|
||||
// application, rather than start the application's message pump.
|
||||
// fine programma
|
||||
LOG_DATETIME( &logger, " End")
|
||||
|
||||
// Exit application with FALSE
|
||||
return FALSE ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
string
|
||||
GetExeNameVer( void)
|
||||
{
|
||||
string sVer ;
|
||||
|
||||
|
||||
GetModuleVersion( NULL, sVer) ;
|
||||
return string( STR_EXE " ver." + sVer) ;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user