diff --git a/API_GdbObjAttribs.cpp b/API_GdbObjAttribs.cpp index 0ecf6c2..d69d1cc 100644 --- a/API_GdbObjAttribs.cpp +++ b/API_GdbObjAttribs.cpp @@ -426,6 +426,25 @@ __stdcall EgtGetInfoFrame( int nId, const wchar_t* wsKey, double ptOrig[3], return TRUE ; } +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtGetAllInfo( int nId, wchar_t*& wsInfos) +{ + if ( &wsInfos == nullptr) + return FALSE ; + STRVECTOR vsInfo ; + if ( ! ExeGetAllInfo( nId, vsInfo)) + return FALSE ; + // restituzione vettore risultati + string sInfos ; + for ( const auto& sInfo : vsInfo) + sInfos += sInfo + "\n" ; + if ( ! sInfos.empty()) + sInfos.pop_back() ; + wsInfos = _wcsdup( stringtoW( sInfos)) ; + return (( wsInfos == nullptr) ? FALSE : TRUE) ; +} + //----------------------------------------------------------------------------- BOOL __stdcall EgtExistsInfo( int nId, const wchar_t* wsKey) diff --git a/API_MachMgr.cpp b/API_MachMgr.cpp index b5ac2b2..18c5a29 100644 --- a/API_MachMgr.cpp +++ b/API_MachMgr.cpp @@ -72,21 +72,19 @@ __stdcall EgtGetMachines( wchar_t*& wsMachineNames, wchar_t*& wsMachineDirs) return FALSE ; // restituzione vettore nomi string sMachineNames ; - for ( const auto& sName : vsMachineNames) { - if ( ! sMachineNames.empty()) - sMachineNames += "\n" ; - sMachineNames += sName ; - } + for ( const auto& sName : vsMachineNames) + sMachineNames += sName + "\n" ; + if ( ! sMachineNames.empty()) + sMachineNames.pop_back() ; wsMachineNames = _wcsdup( stringtoW( sMachineNames)) ; if ( wsMachineNames == nullptr) return FALSE ; // restituzione vettore direttori string sMachineDirs ; - for ( const auto& sName : vsMachineDirs) { - if ( ! sMachineDirs.empty()) - sMachineDirs += "\n" ; - sMachineDirs += sName ; - } + for ( const auto& sName : vsMachineDirs) + sMachineDirs += sName + "\n" ; + if ( ! sMachineDirs.empty()) + sMachineDirs.pop_back() ; wsMachineDirs = _wcsdup( stringtoW( sMachineDirs)) ; if ( wsMachineDirs == nullptr) { free( wsMachineNames) ; @@ -1019,11 +1017,10 @@ __stdcall EgtTdbToBeImported( const wchar_t* wsFile, wchar_t*& wsToolsNames, int return FALSE ; // restituzione vettore nomi string sToolsNames ; - for ( const auto& sName : vsToolsNames) { - if ( ! sToolsNames.empty()) - sToolsNames += "\n" ; - sToolsNames += sName ; - } + for ( const auto& sName : vsToolsNames) + sToolsNames += sName + "\n" ; + if ( ! sToolsNames.empty()) + sToolsNames.pop_back() ; wsToolsNames = _wcsdup( stringtoW( sToolsNames)) ; if ( wsToolsNames == nullptr) return FALSE ; @@ -1061,11 +1058,10 @@ __stdcall EgtTdbImport( const wchar_t* wsFile, const wchar_t* wsToolsToImport, c if ( ! ExeTdbImport( string( wstrztoA( wsFile)), vsToolsToImport, vsToolsNames, vsImported)) return FALSE ; string sImported ; - for ( const auto& sName : vsImported) { - if ( ! sImported.empty()) - sImported += "\n" ; - sImported += sName ; - } + for ( const auto& sName : vsImported) + sImported += sName + "\n" ; + if ( ! sImported.empty()) + sImported.pop_back() ; wsImported = _wcsdup( stringtoW( sImported)) ; return (( wsImported == nullptr) ? FALSE : TRUE) ; } @@ -1369,11 +1365,10 @@ __stdcall EgtMdbToBeImported( const wchar_t* wsFile, wchar_t*& wsMachiningsNames return FALSE ; // restituzione vettore nomi string sMachiningsNames ; - for ( const auto& sName : vsMachiningsNames) { - if ( ! sMachiningsNames.empty()) - sMachiningsNames += "\n" ; - sMachiningsNames += sName ; - } + for ( const auto& sName : vsMachiningsNames) + sMachiningsNames += sName + "\n" ; + if ( ! sMachiningsNames.empty()) + sMachiningsNames.pop_back() ; wsMachiningsNames = _wcsdup( stringtoW( sMachiningsNames)) ; if ( wsMachiningsNames == nullptr) return FALSE ; @@ -1411,11 +1406,10 @@ __stdcall EgtMdbImport( const wchar_t* wsFile, const wchar_t* wsMachiningsToImpo if ( ! ExeMdbImport( string( wstrztoA( wsFile)), vsMachiningsToImport, vsMachiningsNames, vsImported)) return FALSE ; string sImported ; - for ( const auto& sName : vsImported) { - if ( ! sImported.empty()) - sImported += "\n" ; - sImported += sName ; - } + for ( const auto& sName : vsImported) + sImported += sName + "\n" ; + if ( ! sImported.empty()) + sImported.pop_back() ; wsImported = _wcsdup( stringtoW( sImported)) ; return (( wsImported == nullptr) ? FALSE : TRUE) ; } diff --git a/EgtInterface.rc b/EgtInterface.rc index 18ce3bf..cde14c8 100644 Binary files a/EgtInterface.rc and b/EgtInterface.rc differ