EgtExecutor 2.4e3 :

- modifiche per prima gestione chiave di rete.
This commit is contained in:
DarioS
2022-05-17 08:21:53 +02:00
parent f57b9859ba
commit aa17b2b080
8 changed files with 77 additions and 10 deletions
+19 -1
View File
@@ -38,6 +38,7 @@ using namespace std ;
static const char* EEX_SETEEXLOGGER = "SetEExLogger" ;
static const char* EEX_GETEEXVERSION = "GetEExVersion" ;
static const char* EEX_SETEEXKEY = "SetEExKey" ;
static const char* EEX_SETEEXNETHWKEY = "SetEExNetHwKey" ;
static const char* EEX_SETBTLAUXDIR = "SetBtlAuxDir" ;
static const char* EEX_CREATEBEAMMGR = "CreateBeamMgr" ;
static const char* EEX_CREATEIMPORTBTL = "CreateImportBtl" ;
@@ -60,7 +61,7 @@ HMODULE s_hEEx = nullptr ;
//-----------------------------------------------------------------------------
bool
LoadExchangeDll( ILogger* pLogger, const string& sKey)
LoadExchangeDll( ILogger* pLogger, const string& sKey, bool bNetHwKey)
{
// verifico la chiave
if ( ! TestKeyForEEx( sKey, 0, pLogger)) {
@@ -78,6 +79,8 @@ LoadExchangeDll( ILogger* pLogger, const string& sKey)
MySetEExLogger( pLogger) ;
// imposto i codici della chiave
MySetEExKey( sKey) ;
// imposto eventuale chiave di rete
MySetEExNetHwKey( bNetHwKey) ;
return true ;
}
@@ -146,6 +149,21 @@ MySetEExKey( const string& sKey)
pFun( sKey) ;
}
//-----------------------------------------------------------------------------
void
MySetEExNetHwKey( bool bNetHwKey)
{
// verifico caricamento libreria EgtGraphics
if ( s_hEEx == nullptr)
return ;
// recupero funzione che imposta il flag per chiave di rete
typedef void (* PF_SetEExNetHwKey) ( bool bNetHwKey) ;
PF_SetEExNetHwKey pFun = (PF_SetEExNetHwKey)GetProcAddress( s_hEEx, EEX_SETEEXNETHWKEY) ;
if ( pFun == nullptr)
return ;
pFun( bNetHwKey) ;
}
//-----------------------------------------------------------------------------
bool
MySetBtlAuxDir( const string& sBtlAuxDir)
+2 -1
View File
@@ -32,11 +32,12 @@ class IExportSvg ;
class IExcExecutor ;
//----------------------------------------------------------------------------
bool LoadExchangeDll( ILogger* pLogger, const std::string& sKey) ;
bool LoadExchangeDll( ILogger* pLogger, const std::string& sKey, bool bNetHwKey) ;
bool FreeExchangeDll( void) ;
bool IsLoadedExchangeDll( void) ;
void MySetEExLogger( ILogger* pLogger) ;
void MySetEExKey( const std::string& sKey) ;
void MySetEExNetHwKey( bool bNetHwKey) ;
const char* MyGetEExVersion( void) ;
bool MySetBtlAuxDir( const std::string& sBtlAuxDir) ;
IBeamMgr* MyCreateBeamMgr( void) ;
+19 -1
View File
@@ -36,6 +36,7 @@ using namespace std ;
static const char* EGR_SETEGRLOGGER = "SetEGrLogger" ;
static const char* EGR_GETEGRVERSION = "GetEGrVersion" ;
static const char* EGR_SETEGRKEY = "SetEGrKey" ;
static const char* EGR_SETEGRNETHWKEY = "SetEGrNetHwKey" ;
static const char* EGR_CREATEEGRSCENE = "CreateEGrScene" ;
static const char* EGR_CREATESCEEXECUTOR = "CreateSceExecutor" ;
static const char* EGR_CREATEEGRIMAGEMGR = "CreateEgrImageMgr" ;
@@ -46,7 +47,7 @@ HMODULE s_hEGr = nullptr ;
//-----------------------------------------------------------------------------
bool
LoadGraphicsDll( ILogger* pLogger, const string& sKey)
LoadGraphicsDll( ILogger* pLogger, const string& sKey, bool bNetHwKey)
{
// verifico la chiave
if ( ! TestKeyForEGr( sKey, 0, pLogger)) {
@@ -64,6 +65,8 @@ LoadGraphicsDll( ILogger* pLogger, const string& sKey)
MySetEGrLogger( pLogger) ;
// imposto i codici della chiave
MySetEGrKey( sKey) ;
// imposto eventuale chiave di rete
MySetEGrNetHwKey( bNetHwKey) ;
return true ;
}
@@ -132,6 +135,21 @@ MySetEGrKey( const string& sKey)
pFun( sKey) ;
}
//-----------------------------------------------------------------------------
void
MySetEGrNetHwKey( bool bNetHwKey)
{
// verifico caricamento libreria EgtGraphics
if ( s_hEGr == nullptr)
return ;
// recupero funzione che imposta il flag per chiave di rete
typedef void (* PF_SetEGrNetHwKey) ( bool bNetHwKey) ;
PF_SetEGrNetHwKey pFun = (PF_SetEGrNetHwKey)GetProcAddress( s_hEGr, EGR_SETEGRNETHWKEY) ;
if ( pFun == nullptr)
return ;
pFun( bNetHwKey) ;
}
//-----------------------------------------------------------------------------
IEGrScene*
MyCreateEGrScene( void)
+2 -1
View File
@@ -21,11 +21,12 @@ class ISceExecutor ;
class IEgrImageMgr ;
//----------------------------------------------------------------------------
bool LoadGraphicsDll( ILogger* pLogger, const std::string& sKey) ;
bool LoadGraphicsDll( ILogger* pLogger, const std::string& sKey, bool bNetHwKey) ;
bool FreeGraphicsDll( void) ;
bool IsLoadedGraphicsDll( void) ;
void MySetEGrLogger( ILogger* pLogger) ;
void MySetEGrKey( const std::string& sKey) ;
void MySetEGrNetHwKey( bool bNetHwKey) ;
const char* MyGetEGrVersion( void) ;
IEGrScene* MyCreateEGrScene( void) ;
ISceExecutor* MyCreateSceExecutor(void) ;
+19 -1
View File
@@ -36,6 +36,7 @@ using namespace std ;
static const char* EMK_SETEMKLOGGER = "SetEMkLogger" ;
static const char* EMK_GETEMKVERSION = "GetEMkVersion" ;
static const char* EMK_SETEMKKEY = "SetEMkKey" ;
static const char* EMK_SETEMKNETHWKEY = "SetEMkNetHwKey" ;
static const char* EMK_CREATEMACHMGR = "CreateMachMgr" ;
@@ -44,7 +45,7 @@ HMODULE s_hEMk = nullptr ;
//-----------------------------------------------------------------------------
bool
LoadMachKernelDll( ILogger* pLogger, const string& sKey)
LoadMachKernelDll( ILogger* pLogger, const string& sKey, bool bNetHwKey)
{
// verifico la chiave
if ( ! TestKeyForEMk( sKey, 0, pLogger)) {
@@ -62,6 +63,8 @@ LoadMachKernelDll( ILogger* pLogger, const string& sKey)
MySetEMkLogger( pLogger) ;
// imposto i codici della chiave
MySetEMkKey( sKey) ;
// imposto eventuale chiave di rete
MySetEMkNetHwKey( bNetHwKey) ;
return true ;
}
@@ -130,6 +133,21 @@ MySetEMkKey( const string& sKey)
pFun( sKey) ;
}
//-----------------------------------------------------------------------------
void
MySetEMkNetHwKey( bool bNetHwKey)
{
// verifico caricamento libreria EgtGraphics
if ( s_hEMk == nullptr)
return ;
// recupero funzione che imposta il flag per chiave di rete
typedef void (* PF_SetEMkNetHwKey) ( bool bNetHwKey) ;
PF_SetEMkNetHwKey pFun = (PF_SetEMkNetHwKey)GetProcAddress( s_hEMk, EMK_SETEMKNETHWKEY) ;
if ( pFun == nullptr)
return ;
pFun( bNetHwKey) ;
}
//-----------------------------------------------------------------------------
IMachMgr*
MyCreateMachMgr( void)
+2 -1
View File
@@ -19,10 +19,11 @@ class ILogger ;
class IMachMgr ;
//----------------------------------------------------------------------------
bool LoadMachKernelDll( ILogger* pLogger, const std::string& sKey) ;
bool LoadMachKernelDll( ILogger* pLogger, const std::string& sKey, bool bNetHwKey) ;
bool FreeMachKernelDll( void) ;
bool IsLoadedMachKernelDll( void) ;
void MySetEMkLogger( ILogger* pLogger) ;
void MySetEMkKey( const std::string& sKey) ;
void MySetEMkNetHwKey( bool bNetHwKey) ;
const char* MyGetEMkVersion( void) ;
IMachMgr* MyCreateMachMgr( void) ;
+14 -4
View File
@@ -47,6 +47,7 @@ static Logger* s_pCmdLog = nullptr ;
static int s_nUserLev = 1 ;
static string s_sKey ;
static int s_nKeyType = KEY_LOCK_TYPE_ANY ;
static bool s_bNetHwKey = false ;
static int s_nKeyExpDays = 0 ;
static int s_nKeyOptExpDays = 0 ;
static string s_sNestKey ;
@@ -99,20 +100,21 @@ ExeInit( int nDebug, const string& sLogFile, const string& sLogMsg)
// imposto la chiave di protezione sulle librerie di base
SetEGkKeyType( s_nKeyType) ;
SetEGkKey( s_sKey) ;
SetEGkNetHwKey( s_bNetHwKey) ;
// carico libreria grafica opzionale
if ( LoadGraphicsDll( s_pGenLog, s_sKey))
if ( LoadGraphicsDll( s_pGenLog, s_sKey, s_bNetHwKey))
LOG_INFO( s_pGenLog, MyGetEGrVersion())
// carico libreria exchange opzionale
if ( LoadExchangeDll( s_pGenLog, s_sKey))
if ( LoadExchangeDll( s_pGenLog, s_sKey, s_bNetHwKey))
LOG_INFO( s_pGenLog, MyGetEExVersion())
// carico libreria di lavorazione opzionale
if ( LoadMachKernelDll( s_pGenLog, s_sKey))
if ( LoadMachKernelDll( s_pGenLog, s_sKey, s_bNetHwKey))
LOG_INFO( s_pGenLog, MyGetEMkVersion())
// carico libreria neting opzionale
// carico libreria nesting opzionale (non può usare la chiave di rete)
if ( LoadNestingDll( s_pGenLog, s_sKey, s_sNestKey))
LOG_INFO( s_pGenLog, MyGetENsVersion())
@@ -249,6 +251,14 @@ ExeSetLockType( int nType)
return SetLockType( nType) ;
}
//-----------------------------------------------------------------------------
bool
ExeSetNetHwKey( bool bNetHwKey)
{
s_bNetHwKey = bNetHwKey ;
return SetNetHwKey( bNetHwKey) ;
}
//-----------------------------------------------------------------------------
bool
ExeSetFont( const string& sNfeFontDir, const string& sDefaultFont)
BIN
View File
Binary file not shown.