From ced749f93d4f5e09442f736b212f084d0c065df6 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 25 Mar 2021 08:52:35 +0000 Subject: [PATCH] EgtInterface 2.3c2 : - aggiornata interfaccia di EgtTdbToBeImported per nuovo parametro. --- API_GdbPartLayers.cpp | 4 +++- API_MachMgr.cpp | 27 +++++++++++++++++++++++---- EgtInterface.rc | Bin 11718 -> 11718 bytes 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/API_GdbPartLayers.cpp b/API_GdbPartLayers.cpp index c4fe4ac..4ec089d 100644 --- a/API_GdbPartLayers.cpp +++ b/API_GdbPartLayers.cpp @@ -200,6 +200,8 @@ __stdcall EgtDuploCount( int nSouId, int* pnCount) BOOL __stdcall EgtDuploList( int nSouId, int*& vInd, int* pnCount) { + if ( &vInd == nullptr || pnCount == nullptr) + return FALSE ; INTVECTOR vnRef ; if ( ! ExeDuploList( nSouId, vnRef)) return FALSE ; @@ -210,7 +212,7 @@ __stdcall EgtDuploList( int nSouId, int*& vInd, int* pnCount) else { vInd = (int*) malloc( nDim * sizeof( int)) ; if ( vInd == nullptr) - return false ; + return FALSE ; for ( int i = 0 ; i < nDim ; ++ i) vInd[i] = vnRef[i] ; } diff --git a/API_MachMgr.cpp b/API_MachMgr.cpp index a1c7b0f..f234b2a 100644 --- a/API_MachMgr.cpp +++ b/API_MachMgr.cpp @@ -905,13 +905,15 @@ __stdcall EgtTdbExport( const wchar_t* wsToolsNames, const wchar_t* wsOutFile) //----------------------------------------------------------------------------- BOOL -__stdcall EgtTdbToBeImported( const wchar_t* wsFile, wchar_t*& wsToolsNames) +__stdcall EgtTdbToBeImported( const wchar_t* wsFile, wchar_t*& wsToolsNames, int*& vTypes, int* pnCount) { - if ( &wsToolsNames == nullptr) + if ( &wsToolsNames == nullptr || &vTypes == nullptr || pnCount == nullptr) return FALSE ; STRVECTOR vsToolsNames ; - if ( ! ExeTdbToBeImported( string( wstrztoA( wsFile)), vsToolsNames)) + INTVECTOR vToolsTypes ; + if ( ! ExeTdbToBeImported( string( wstrztoA( wsFile)), vsToolsNames, vToolsTypes)) return FALSE ; + // restituzione vettore nomi string sToolsNames ; for ( const auto& sName : vsToolsNames) { if ( ! sToolsNames.empty()) @@ -919,7 +921,24 @@ __stdcall EgtTdbToBeImported( const wchar_t* wsFile, wchar_t*& wsToolsNames) sToolsNames += sName ; } wsToolsNames = _wcsdup( stringtoW( sToolsNames)) ; - return (( wsToolsNames == nullptr) ? FALSE : TRUE) ; + if ( wsToolsNames == nullptr) + return FALSE ; + // restituzione vettore tipi + int nDim = int( vToolsTypes.size()) ; + if ( nDim == 0) { + vTypes = nullptr ; + } + else { + vTypes = (int*) malloc( nDim * sizeof( int)) ; + if ( vTypes == nullptr) { + free( wsToolsNames) ; + return FALSE ; + } + for ( int i = 0 ; i < nDim ; ++ i) + vTypes[i] = vToolsTypes[i] ; + } + *pnCount = nDim ; + return TRUE ; } //----------------------------------------------------------------------------- diff --git a/EgtInterface.rc b/EgtInterface.rc index fab1ab1a5e0bb2f555b0e8a3c2b40ec771f849bc..8581d30bf98a09d2bc0b5d9b0ebccb34f6cae561 100644 GIT binary patch delta 111 zcmX>WeJpyzFE&P_%^&$rGEF|hS;uHJ`Jtfh<^rw;7OzIAO+TQQ4Xt~E@c}o07g?Nt^fc4 delta 111 zcmX>WeJpyzFE&QQ%^&$rGEF|hS;uHN`Jtfh<^rw;7OzIAO+TQQ4Xt~E@c}o07PdfrT_o{