diff --git a/DllMain.h b/DllMain.h index a694cb1..e635221 100644 --- a/DllMain.h +++ b/DllMain.h @@ -15,6 +15,8 @@ #include "/EgtDev/Include/EgtILogger.h" +#include //----------------------------------------------------------------------------- ILogger* GetEGkLogger( void) ; +const std::string& GetEGkKey( void) ; diff --git a/EGkDllMain.cpp b/EGkDllMain.cpp index a8934be..764ec7b 100644 --- a/EGkDllMain.cpp +++ b/EGkDllMain.cpp @@ -91,6 +91,23 @@ GetEGkLogger( void) return s_pLogger ; } +//----------------------------------------------------------------------------- +static std::string s_sKey ; + +//----------------------------------------------------------------------------- +void +SetEGkKey( const std::string& sKey) +{ + s_sKey = sKey ; +} + +//----------------------------------------------------------------------------- +const std::string& +GetEGkKey( void) +{ + return s_sKey ; +} + //----------------------------------------------------------------------------- void InitFontManager( const std::string& sNfeFontDir, const std::string& sDefaultFont) diff --git a/EgtGeomKernel.rc b/EgtGeomKernel.rc index 4fb9aa1..e183462 100644 Binary files a/EgtGeomKernel.rc and b/EgtGeomKernel.rc differ diff --git a/GeomDB.cpp b/GeomDB.cpp index a449c75..fe3b6a8 100644 --- a/GeomDB.cpp +++ b/GeomDB.cpp @@ -23,6 +23,7 @@ #include "/EgtDev/Include/EGkStringUtils3d.h" #include "/EgtDev/Include/EgnStringConverter.h" #include "/EgtDev/Include/EgtPointerOwner.h" +#include "/EgtDev/Include/SELkKeyProc.h" #include using namespace std ; @@ -31,6 +32,14 @@ using namespace std ; IGeomDB* CreateGeomDB( void) { + // verifico la chiave + int nRet = VerifyKey( GetEGkKey(), 1231, 15, 1) ; + if ( nRet != KEY_OK) { + string sErr = "Error on Key (" + ToString( nRet) + ")" ; + LOG_ERROR( GetEGkLogger(), sErr.c_str()) ; + return nullptr ; + } + // creo il GeomDB return static_cast ( new(nothrow) GeomDB) ; } diff --git a/stdafx.h b/stdafx.h index 8712f37..829862a 100644 --- a/stdafx.h +++ b/stdafx.h @@ -31,3 +31,4 @@ #pragma comment(lib, EGTEXTDIR "zlib/lib/zlib" EGTLIBVER ".lib") #pragma comment(lib, EGTLIBDIR "EgtGeneral" EGTLIBVER ".lib") #pragma comment(lib, EGTLIBDIR "EgtNumKernel" EGTLIBVER ".lib") +#pragma comment(lib, EGTLIBDIR "SEgtLock" EGTLIBVER ".lib")