Include :

- sistemazione prototipi per passaggio import/export 3dm da Exchange a Exch3dm.
This commit is contained in:
Dario Sassi
2023-11-14 19:11:35 +01:00
parent ddd7f858a4
commit 841dddf047
3 changed files with 85 additions and 12 deletions
+73
View File
@@ -0,0 +1,73 @@
//----------------------------------------------------------------------------
// EgalTech 2023-2023
//----------------------------------------------------------------------------
// File : EE3DllMain.h Data : 14.11.23 Versione : 2.5k2
// Contenuto : Prototipi funzioni generali della DLL.
//
//
//
// Modifiche : 14.11.23 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include <string>
class ILogger ;
//----------------------- Macro per import/export ----------------------------
#undef EE3_EXPORT
#if defined( I_AM_EE3) // da definirsi solo nella DLL
#define EE3_EXPORT __declspec( dllexport)
#else
#define EE3_EXPORT __declspec( dllimport)
#endif
//-----------------------------------------------------------------------------
// E' necessaria l'interfaccia in C per caricare queste funzioni dinamicamente
extern "C" {
// restituisce la versione della Dll
EE3_EXPORT const char* GetEE3Version( void) ;
// permette di impostare il logger per la Dll
EE3_EXPORT void SetEE3Logger( ILogger* pLogger) ;
// imposta la chiave di protezione
EE3_EXPORT void SetEE3Key( const std::string& sKey) ;
// imposta se chiave hardware di rete
EE3_EXPORT void SetEE3NetHwKey( bool bNetHwKey) ;
}
//-----------------------------------------------------------------------------
#include "/EgtDev/Include/EGnStringUtils.h"
#include "/EgtDev/Include/EgtILogger.h"
#include "/EgtDev/Include/EgtKeyCodes.h"
#include "/EgtDev/Include/SELkKeyProc.h"
//-----------------------------------------------------------------------------
// Test della chiave per caricare la DLL
inline bool
TestKeyForEE3( const std::string& sKey, int nKeyOpt, ILogger* pLogger)
{
// verifico la chiave e le opzioni
unsigned int nOpt1, nOpt2 ;
int nOptExpDays ;
int nRet = GetKeyOptions( sKey, KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV,
nOpt1, nOpt2, nOptExpDays) ;
if ( nRet != KEY_OK && ! EqualNoCase( sKey, "EE3Base")) {
if ( nRet != KEY_OK) {
std::string sErr = "Error on Key (EE3/" + ToString( nRet) + ")" ;
LOG_ERROR( pLogger, sErr.c_str()) ;
return false ;
}
if ( ( nOpt1 & ( KEYOPT_EEX_INPBASE|KEYOPT_EEX_EXPBASE)) == 0 ||
( nKeyOpt != 0 && ( nOpt1 & nKeyOpt) == 0) ||
nOptExpDays < GetCurrDay()) {
std::string sErr = "Warning on Key (EE3/OPT)" ;
LOG_ERROR( pLogger, sErr.c_str()) ;
return false ;
}
}
return true ;
}
+6 -6
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2023
//----------------------------------------------------------------------------
// File : EExExport3dm.h Data : 21.09.23 Versione :
// File : EE3Export3dm.h Data : 21.09.23 Versione :
// Contenuto : Dichiarazione della interfaccia IExport3dm.
//
//
@@ -18,11 +18,11 @@
#include <string>
//----------------------- Macro per import/export ----------------------------
#undef EEK_EXPORT
#if defined( I_AM_EEX) // da definirsi solo nella DLL
#define EEX_EXPORT __declspec( dllexport)
#undef EE3_EXPORT
#if defined( I_AM_EE3) // da definirsi solo nella DLL
#define EE3_EXPORT __declspec( dllexport)
#else
#define EEX_EXPORT __declspec( dllimport)
#define EE3_EXPORT __declspec( dllimport)
#endif
//-----------------------------------------------------------------------------
@@ -36,5 +36,5 @@ public :
//-----------------------------------------------------------------------------
extern "C" {
EEX_EXPORT IExport3dm* CreateExport3dm(void) ;
EE3_EXPORT IExport3dm* CreateExport3dm(void) ;
}
+6 -6
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2023
//----------------------------------------------------------------------------
// File : EExImport3dm.h Data : 26.06.23 Versione : 2.5f1
// File : EE3Import3dm.h Data : 26.06.23 Versione : 2.5f1
// Contenuto : Dichiarazione della interfaccia IImport3dm.
//
//
@@ -16,11 +16,11 @@
#include <string>
//----------------------- Macro per import/export ----------------------------
#undef EEK_EXPORT
#if defined( I_AM_EEX) // da definirsi solo nella DLL
#define EEX_EXPORT __declspec( dllexport)
#undef EE3_EXPORT
#if defined( I_AM_EE3) // da definirsi solo nella DLL
#define EE3_EXPORT __declspec( dllexport)
#else
#define EEX_EXPORT __declspec( dllimport)
#define EE3_EXPORT __declspec( dllimport)
#endif
//-----------------------------------------------------------------------------
@@ -35,5 +35,5 @@ public :
//-----------------------------------------------------------------------------
extern "C" {
EEX_EXPORT IImport3dm* CreateImport3dm( void) ;
EE3_EXPORT IImport3dm* CreateImport3dm( void) ;
}