Files
EgtGeomKernel/EGkDllMain.cpp
T
2013-12-11 18:30:56 +00:00

60 lines
1.9 KiB
C++

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