Files
EgtGeneral/EGnDllMain.cpp
T
2013-12-21 16:16:04 +00:00

60 lines
1.8 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2013-2013
//----------------------------------------------------------------------------
// File : EGnDllMain.cpp Data : 20.11.13 Versione : 1.3a1
// Contenuto : Inizializzazione della DLL.
//
//
//
// Modifiche : 20.11.13 DS Creazione modulo.
// 21.11.13 DS Agg. GetEGnVersion.
//
//----------------------------------------------------------------------------
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include <\EgtDev\Include\EGnDllMain.h>
#include <\EgtDev\Include\EgnGetModuleVer.h>
#include <\EgtDev\Include\EgtTrace.h>
//--------------------------- Costanti ----------------------------------------
#if defined( _DEBUG)
const char* EGN_STR = "EgtGeneralD32.dll ver. " ;
#else
const char* EGN_STR = "EgtGeneralR32.dll ver. " ;
#endif
const int STR_DIM = 40 ;
//-----------------------------------------------------------------------------
static HINSTANCE s_hModule = NULL ;
static char s_szEGnNameVer[STR_DIM] ;
//-----------------------------------------------------------------------------
BOOL APIENTRY
DllMain( HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
{
if ( dwReason == DLL_PROCESS_ATTACH) {
s_hModule = hModule ;
EGT_TRACE( "EgtGeneral.dll Initializing!\n") ;
}
else if ( dwReason == DLL_PROCESS_DETACH) {
s_hModule = NULL ;
EGT_TRACE( "EgtGeneral.dll Terminating!\n") ;
}
return 1 ;
}
//-----------------------------------------------------------------------------
const char*
GetEGnVersion( void)
{
std::string sVer ;
GetModuleVersion( s_hModule, sVer) ;
sprintf_s( s_szEGnNameVer, STR_DIM, "%s%s", EGN_STR, sVer.c_str()) ;
return s_szEGnNameVer ;
}