From de46b19ee827beff8e8780c0306a18da8fdc1893 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 30 Mar 2015 06:49:47 +0000 Subject: [PATCH] EgtGraphics 1.6c4 : - aggiunta gestione codici di protezione (con opzioni). --- DllMain.h | 2 ++ EGrDllMain.cpp | 37 +++++++++++++++++++--------- EgtGraphics.rc | Bin 11580 -> 11604 bytes EgtGraphics.vcxproj.filters | 47 +++++++++++++++++++----------------- SceneBasic.cpp | 18 ++++++++++++++ stdafx.h | 1 + 6 files changed, 71 insertions(+), 34 deletions(-) diff --git a/DllMain.h b/DllMain.h index f96dcc4..db8ec82 100644 --- a/DllMain.h +++ b/DllMain.h @@ -15,6 +15,8 @@ #include "/EgtDev/Include/EgtILogger.h" +#include //----------------------------------------------------------------------------- ILogger* GetEGrLogger( void) ; +const std::string& GetEGrKey( void) ; diff --git a/EGrDllMain.cpp b/EGrDllMain.cpp index 691468f..0e8b1df 100644 --- a/EGrDllMain.cpp +++ b/EGrDllMain.cpp @@ -19,18 +19,14 @@ #include "/EgtDev/Include/EgtTrace.h" //--------------------------- Costanti ---------------------------------------- -#if defined( _WIN64) - #if defined( _DEBUG) - const char* EGR_STR = "EgtGraphicsD64.dll ver. " ; - #else - const char* EGR_STR = "EgtGraphicsR64.dll ver. " ; - #endif -#elif defined( _WIN32) - #if defined( _DEBUG) - const char* EGR_STR = "EgtGraphicsD32.dll ver. " ; - #else - const char* EGR_STR = "EgtGraphicsR32.dll ver. " ; - #endif +#if defined( _WIN64) && defined( _DEBUG) + const char* EGR_STR = "EgtGraphicsD64.dll ver. " ; +#elif defined( _WIN64) + const char* EGR_STR = "EgtGraphicsR64.dll ver. " ; +#elif defined( _WIN32) && defined( _DEBUG) + const char* EGR_STR = "EgtGraphicsD32.dll ver. " ; +#else + const char* EGR_STR = "EgtGraphicsR32.dll ver. " ; #endif const int STR_DIM = 40 ; @@ -90,3 +86,20 @@ GetEGrLogger( void) { return s_pLogger ; } + +//----------------------------------------------------------------------------- +static std::string s_sKey ; + +//----------------------------------------------------------------------------- +void +SetEGrKey( const std::string& sKey) +{ + s_sKey = sKey ; +} + +//----------------------------------------------------------------------------- +const std::string& +GetEGrKey( void) +{ + return s_sKey ; +} diff --git a/EgtGraphics.rc b/EgtGraphics.rc index a04bef45b096af5a19332aa678b9b086cf8fd8bb..967d0cda494533195503d8d1128a7bed403f6f12 100644 GIT binary patch delta 128 zcmdlJbtP)UFE&P#&4qG;%#0?J3%PVBe~>hoY#`0H`GKMY$ delta 119 zcmcZ-wI^!BFE&Qw%?J7RGfm>rnVhGn#%MhGptSB}86ktsMp9yoo7=dpn87M^ffQUS VNXU-`Q`AT*03wRhG(KfFE&%b&BXj@& diff --git a/EgtGraphics.vcxproj.filters b/EgtGraphics.vcxproj.filters index 7ebd736..3c0e414 100644 --- a/EgtGraphics.vcxproj.filters +++ b/EgtGraphics.vcxproj.filters @@ -13,6 +13,9 @@ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + {8f14972c-68c0-465e-8939-e4ee1eeef53a} + @@ -21,56 +24,56 @@ File di intestazione - - File di intestazione - File di intestazione - - File di intestazione - File di intestazione File di intestazione - - File di intestazione - - - File di intestazione - File di intestazione File di intestazione - - File di intestazione - File di intestazione File di intestazione - - File di intestazione - File di intestazione - File di intestazione + File di intestazione\Include - - File di intestazione + + File di intestazione\Include - File di intestazione + File di intestazione\Include + + + File di intestazione\Include + + + File di intestazione\Include + + + File di intestazione\Include + + + File di intestazione\Include + + + File di intestazione\Include + + + File di intestazione\Include File di intestazione diff --git a/SceneBasic.cpp b/SceneBasic.cpp index 84c70ff..b9c7371 100644 --- a/SceneBasic.cpp +++ b/SceneBasic.cpp @@ -21,6 +21,8 @@ #include "/EgtDev/Include/EGkFrame3d.h" #include "/EgtDev/Include/EGkGdbConst.h" #include "/EgtDev/Include/EGkGeomDB.h" +#include "/EgtDev/Include/SELkKeyProc.h" +#include "/EgtDev/Include/EgtKeyCodes.h" using namespace std ; @@ -34,6 +36,22 @@ static const double MIN_ZCLIP_EXT = 5000 ; IEGrScene* CreateEGrScene( void) { + // verifico la chiave e le opzioni + unsigned int nOpt1, nOpt2 ; + int nOptExpDays ; + int nRet = GetKeyOptions( GetEGrKey(), KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV, + nOpt1, nOpt2, nOptExpDays) ; + if ( nRet != KEY_OK) { + string sErr = "Error on Key (GRC/" + ToString( nRet) + ")" ; + LOG_ERROR( GetEGrLogger(), sErr.c_str()) ; + return false ; + } + if ( (nOpt1 & KEYOPT_EGR_BASE) == 0 || nOptExpDays < GetCurrDay()) { + string sErr = "Error on Key (GRC/OPT)" ; + LOG_ERROR( GetEGrLogger(), sErr.c_str()) ; + return false ; + } + // creo l'oggetto return static_cast ( new(nothrow) Scene) ; } diff --git a/stdafx.h b/stdafx.h index 360af94..17703b9 100644 --- a/stdafx.h +++ b/stdafx.h @@ -38,3 +38,4 @@ #pragma comment(lib, EGTLIBDIR "EgtGeneral" EGTLIBVER ".lib") #pragma comment(lib, EGTLIBDIR "EgtGeomKernel" EGTLIBVER ".lib") +#pragma comment(lib, EGTLIBDIR "SEgtLock" EGTLIBVER ".lib")