ab5223c4f5
- miglioria in inperpolazione curve per pezzi piani Stone.
89 lines
2.7 KiB
C++
89 lines
2.7 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2015-2015
|
|
//----------------------------------------------------------------------------
|
|
// File : EXcDllMain.cpp Data : 04.05.15 Versione : 1.6e11
|
|
// Contenuto : Inizializzazione della DLL.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 04.05.15 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
//--------------------------- Include ----------------------------------------
|
|
#include "stdafx.h"
|
|
#include "DllMain.h"
|
|
#include "/EgtDev/Include/EXeDllMain.h"
|
|
#include "/EgtDev/Include/EGnGetModuleVer.h"
|
|
#include "/EgtDev/Include/EgtTrace.h"
|
|
|
|
//--------------------------- Costanti ----------------------------------------
|
|
#if defined( _WIN64)
|
|
#if defined( _DEBUG)
|
|
const char* EXE_STR = "EgtExecutorD64.dll ver. " ;
|
|
#else
|
|
const char* EXE_STR = "EgtExecutorR64.dll ver. " ;
|
|
#endif
|
|
#elif defined( _WIN32)
|
|
#if defined( _DEBUG)
|
|
const char* EXE_STR = "EgtExecutorD32.dll ver. " ;
|
|
#else
|
|
const char* EXE_STR = "EgtExecutorR32.dll ver. " ;
|
|
#endif
|
|
#endif
|
|
const int STR_DIM = 50 ;
|
|
|
|
//-----------------------------------------------------------------------------
|
|
static HINSTANCE s_hModule = nullptr ;
|
|
|
|
//-----------------------------------------------------------------------------
|
|
BOOL APIENTRY
|
|
DllMain( HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
|
|
{
|
|
|
|
if ( dwReason == DLL_PROCESS_ATTACH) {
|
|
// Controllo commentato per problemi con VB.NET
|
|
//#if defined( NDEBUG)
|
|
// BOOL IsDbgPresent = FALSE ;
|
|
// CheckRemoteDebuggerPresent( GetCurrentProcess(), &IsDbgPresent) ;
|
|
// if ( IsDbgPresent)
|
|
// return 0 ;
|
|
//#endif
|
|
// se debug, imposto stampe memory leaks all'uscita
|
|
#if defined ( _DEBUG)
|
|
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF) ;
|
|
#endif
|
|
// eseguo
|
|
s_hModule = hModule ;
|
|
EGT_TRACE( "EgtExecutor.dll Initializing!\n") ;
|
|
}
|
|
else if ( dwReason == DLL_PROCESS_DETACH) {
|
|
s_hModule = nullptr ;
|
|
EGT_TRACE( "EgtExecutor.dll Terminating!\n") ;
|
|
}
|
|
|
|
return 1 ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
const char*
|
|
GetEXeVersion( void)
|
|
{
|
|
static char s_szEXeNameVer[STR_DIM] = "" ;
|
|
if ( s_szEXeNameVer[0] == '\0') {
|
|
std::string sVer ;
|
|
GetModuleVersion( s_hModule, sVer) ;
|
|
sprintf_s( s_szEXeNameVer, STR_DIM, "%s%s", EXE_STR, sVer.c_str()) ;
|
|
}
|
|
|
|
return s_szEXeNameVer ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
HINSTANCE
|
|
GetModuleIstance( void)
|
|
{
|
|
return s_hModule ;
|
|
}
|