From fdb711eea62e7f81dc3ff93ecea83fa7eeab3a34 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 18 Mar 2019 06:51:20 +0000 Subject: [PATCH] Include : - aggiornamento prototipi. --- EInAPI.h | 3 +++ EMkMachiningGeoConst.h | 2 ++ EXeExecutor.h | 3 +++ EgtIniFile.h | 32 ++++++++++++-------------------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/EInAPI.h b/EInAPI.h index fb5c0d0..c77f0c8 100644 --- a/EInAPI.h +++ b/EInAPI.h @@ -63,6 +63,9 @@ EIN_EXPORT BOOL __stdcall EgtSetOutText( pfOutTextW pFun) ; EIN_EXPORT BOOL __stdcall EgtSetTempDir( const wchar_t* wsTempDir) ; EIN_EXPORT BOOL __stdcall EgtGetTempDir( wchar_t*& wsTempDir) ; EIN_EXPORT BOOL __stdcall EgtSetMainWindowHandle( HWND hMainWnd) ; +EIN_EXPORT BOOL __stdcall EgtGetStringUtf8FromIni( const wchar_t* wsSec, const wchar_t* wsKey, const wchar_t* wsDef, + wchar_t*& wsVal, const wchar_t* wsIniFile) ; +EIN_EXPORT BOOL __stdcall EgtWriteStringUtf8ToIni( const wchar_t* wsSec, const wchar_t* wsKey, const wchar_t* wsVal, const wchar_t* wsIniFile) ; // UiUnits EIN_EXPORT BOOL __stdcall EgtSetUiUnits( BOOL bMM) ; diff --git a/EMkMachiningGeoConst.h b/EMkMachiningGeoConst.h index 5008456..60ac956 100644 --- a/EMkMachiningGeoConst.h +++ b/EMkMachiningGeoConst.h @@ -22,6 +22,8 @@ static std::string KEY_PHASE = "PH" ; static std::string KEY_IDS = "IDS" ; // Chiave per conteggio elementi geometrici di lavorazione static std::string KEY_NUM = "NUM" ; +// Chiave per stato di aggiornamento di lavorazione +static std::string KEY_STAT = "STAT" ; // Sottogruppi delle lavorazioni static std::string MCH_AUX = "AUX" ; static std::string MCH_PV = "PV" ; diff --git a/EXeExecutor.h b/EXeExecutor.h index ea9a7c8..e92bd97 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -65,6 +65,9 @@ EXE_EXPORT bool ExeOutText( const std::string& sText) ; EXE_EXPORT bool ExeSetTempDir( const std::string& sTempDir) ; EXE_EXPORT bool ExeGetTempDir( std::string& sTempDir) ; EXE_EXPORT bool ExeSetMainWindowHandle( HWND hMainWnd) ; +EXE_EXPORT bool ExeGetStringUtf8FromIni( const std::string& sSec, const std::string& sKey, const std::string& sDef, + std::string& sVal, const std::string& sIniFile) ; +EXE_EXPORT bool ExeWriteStringUtf8ToIni( const std::string& sSec, const std::string& sKey, const std::string& sVal, const std::string& sIniFile) ; // UiUnits EXE_EXPORT bool ExeSetUiUnits( bool bMM) ; diff --git a/EgtIniFile.h b/EgtIniFile.h index dde8d58..ab4904d 100644 --- a/EgtIniFile.h +++ b/EgtIniFile.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2013-2013 +// EgalTech 2013-2019 //---------------------------------------------------------------------------- -// File : EgtIniFile.h Data : 10.12.13 Versione : 1.4a4 +// File : EgtIniFile.h Data : 17.03.19 Versione : 2.1c2 // Contenuto : Funzioni per leggere e scrivere stringhe UTF-8 in file INI. // // @@ -21,36 +21,28 @@ inline std::string GetPrivateProfileStringUtf8( const char* szSection, const char* szKey, const char* szDefault, const char* szIniFile) { - int nChar ; - wchar_t szBuffW[_MAX_PATH] ; - - // leggo la stringa dal file INI come ANSI/UTF-8 in WChar e metto in Char - nChar = GetPrivateProfileStringW( AtoW( szSection), AtoW( szKey), NULL, szBuffW, _MAX_PATH, AtoW( szIniFile)) ; + wchar_t szBuffW[_MAX_PATH] ; + int nChar = GetPrivateProfileStringW( AtoW( szSection), AtoW( szKey), NULL, szBuffW, _MAX_PATH, AtoW( szIniFile)) ; - if ( nChar > 0) { - return LPSTR( WtoAEX<>( szBuffW, CP_ACP)) ; - } - else + if ( nChar <= 0) return szDefault ; + + return LPSTR( WtoAEX<>( szBuffW, CP_ACP)) ; } //---------------------------------------------------------------------------- inline std::string GetPrivateProfileStringUtf8( const char* szSection, const char* szKey, const char* szDefault, const wchar_t* szIniFile) { - int nChar ; - wchar_t szBuffW[_MAX_PATH] ; - - // leggo la stringa dal file INI come ANSI/UTF-8 in WChar e metto in Char - nChar = GetPrivateProfileStringW( AtoW( szSection), AtoW( szKey), NULL, szBuffW, _MAX_PATH, szIniFile) ; + wchar_t szBuffW[_MAX_PATH] ; + int nChar = GetPrivateProfileStringW( AtoW( szSection), AtoW( szKey), NULL, szBuffW, _MAX_PATH, szIniFile) ; - if ( nChar > 0) { - return LPSTR( WtoAEX<>( szBuffW, CP_ACP)) ; - } - else + if ( nChar <= 0) return szDefault ; + + return LPSTR( WtoAEX<>( szBuffW, CP_ACP)) ; } //----------------------------------------------------------------------------