Files
EgtInterface/EInDllMain.cpp
T
Dario Sassi 2c4de5c4f4 EgtInterface 1.5h1 :
- primo commit.
2014-08-31 10:24:17 +00:00

69 lines
2.0 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2014-2014
//----------------------------------------------------------------------------
// File : EInDllMain.cpp Data : 26.08.14 Versione : 1.5h1
// Contenuto : Inizializzazione della DLL.
//
//
//
// Modifiche : 26.08.14 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "/EgtDev/Include/EInDllMain.h"
#include "/EgtDev/Include/EGnGetModuleVer.h"
#include "/EgtDev/Include/EgtTrace.h"
//--------------------------- Costanti ----------------------------------------
#if defined( _WIN64)
#if defined( _DEBUG)
const char* EIN_STR = "EgtInterfaceD64.dll ver. " ;
#else
const char* EIN_STR = "EgtInterfaceR64.dll ver. " ;
#endif
#elif defined( _WIN32)
#if defined( _DEBUG)
const char* EIN_STR = "EgtInterfaceD32.dll ver. " ;
#else
const char* EIN_STR = "EgtInterfaceR32.dll ver. " ;
#endif
#endif
const int STR_DIM = 40 ;
//-----------------------------------------------------------------------------
static HINSTANCE s_hModule = NULL ;
static char s_szEInNameVer[STR_DIM] ;
//-----------------------------------------------------------------------------
BOOL APIENTRY
DllMain( HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
{
if ( dwReason == DLL_PROCESS_ATTACH) {
s_hModule = hModule ;
EGT_TRACE( "EgtInterface.dll Initializing!\n") ;
}
else if ( dwReason == DLL_PROCESS_DETACH) {
s_hModule = NULL ;
EGT_TRACE( "EgtInterface.dll Terminating!\n") ;
}
return 1 ;
}
//-----------------------------------------------------------------------------
const char*
GetEInVersion( void)
{
std::string sVer ;
GetModuleVersion( s_hModule, sVer) ;
sprintf_s( s_szEInNameVer, STR_DIM, "%s%s", EIN_STR, sVer.c_str()) ;
return s_szEInNameVer ;
}