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 fab1ab1..8581d30 100644 Binary files a/EgtInterface.rc and b/EgtInterface.rc differ