From 691e28a3a2d4ac9f2ba17b22372b628ab96aa083 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 17 Jun 2015 07:15:52 +0000 Subject: [PATCH] git-svn-id: svn://10.65.10.50/branches/R_10_00@23115 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- SSAservice/SSAmain.cpp | 2 ++ SSAservice/SSAservice.cpp | 6 +++--- ha/hacnvlib.cpp | 14 ++++---------- ha/hacnvlib.h | 4 ++-- mr/mr2200.cpp | 8 ++++---- mr/mrplib.cpp | 15 ++------------- pe/pe0400.cpp | 3 ++- tc/tc2100.cpp | 6 ------ tp/tp0100.cpp | 7 +------ 9 files changed, 20 insertions(+), 45 deletions(-) diff --git a/SSAservice/SSAmain.cpp b/SSAservice/SSAmain.cpp index cc6bd3800..4ef031e96 100644 --- a/SSAservice/SSAmain.cpp +++ b/SSAservice/SSAmain.cpp @@ -19,6 +19,7 @@ #pragma region Includes #include "SSAservice.h" #include "ServiceInstaller.h" +#include #pragma endregion // @@ -68,6 +69,7 @@ int wmain(int argc, wchar_t *argv[]) InstallService( SERVICE_NAME, // Name of service SERVICE_DISPLAY_NAME, // Name to display + SERVICE_WIN32_OWN_PROCESS, SERVICE_START_TYPE, // Service start type SERVICE_DEPENDENCIES, // Dependencies SERVICE_ACCOUNT, // Service running account diff --git a/SSAservice/SSAservice.cpp b/SSAservice/SSAservice.cpp index bd36a7f5d..b524c1db3 100644 --- a/SSAservice/SSAservice.cpp +++ b/SSAservice/SSAservice.cpp @@ -3,6 +3,7 @@ #include "ThreadPool.h" #include "PathName.h" +#include #include #pragma comment(lib, "Psapi.lib") @@ -100,10 +101,9 @@ BOOL CSSAservice::FindOrCreateAgent(HANDLE& hProcess, DWORD& pid) const void CSSAservice::CheckDirectory() const { - char full[_MAX_PATH]; - ::GetModuleFileNameA(NULL, full, sizeof(full)); + char full[_MAX_PATH] = {0}; ::GetModuleFileNameA(NULL, full, sizeof(full)); CPathName pn = full; - ::SetCurrentDirectoryA(pn.Path().c_str()); + ::SetCurrentDirectoryA(pn.Path()); } CSSAservice::CSSAservice(LPCTSTR pszServiceName, diff --git a/ha/hacnvlib.cpp b/ha/hacnvlib.cpp index 5b1b76aba..d4b959868 100755 --- a/ha/hacnvlib.cpp +++ b/ha/hacnvlib.cpp @@ -15,7 +15,7 @@ bool THardy_iterator::cancelled() const { - return _pi != NULL && _pi->iscancelled(); + return _pi != NULL && _pi->is_cancelled(); } bool THardy_iterator::ok() const @@ -28,7 +28,7 @@ bool THardy_iterator::ok() const THardy_iterator& THardy_iterator::operator=(TRecnotype n) { if (_pi != NULL) - _pi->setstatus(n+1); + _pi->set_status(n+1); _ht->recordset().move_to(_rec = n); return *this; } @@ -43,10 +43,7 @@ THardy_iterator::THardy_iterator(THardy_transfer* ht) : _ht(ht), _pi(NULL) const TRecnotype tot = _ht->recordset().items(); TString title; title << _ht->title() << ": " << tot << ' ' << TR("righe"); - if (tot > 1) - _pi = new TProgind(tot, title, true, true); - else - ::begin_wait(); + _pi = new TProgress_monitor(tot, title); if (tot > 0) _ht->log(title); @@ -56,10 +53,7 @@ THardy_iterator::THardy_iterator(THardy_transfer* ht) : _ht(ht), _pi(NULL) THardy_iterator::~THardy_iterator() { - if (_pi != NULL) - delete _pi; - else - ::end_wait(); + delete _pi; } /////////////////////////////////////////////////////////// diff --git a/ha/hacnvlib.h b/ha/hacnvlib.h index d1fbcb52c..cbb5b0369 100755 --- a/ha/hacnvlib.h +++ b/ha/hacnvlib.h @@ -18,7 +18,7 @@ #endif #ifndef __PROGIND_H -class TProgind; +#include #endif #ifndef __MODAUT_H @@ -97,7 +97,7 @@ public: class THardy_iterator { THardy_transfer* _ht; - TProgind* _pi; + TProgress_monitor* _pi; TRecnotype _rec; public: diff --git a/mr/mr2200.cpp b/mr/mr2200.cpp index 71b916267..e6c9445a5 100755 --- a/mr/mr2200.cpp +++ b/mr/mr2200.cpp @@ -4016,8 +4016,8 @@ void TPlanning_mask::create_browse1(TEdit_field& kfld, int level, short key_id, TScanner scan(tmp); while (scan.pop() != "EN") kfld.parse_item(scan); - - xvt_fsys_removefile(tmp); + scan.close(); + xvt_fsys_remove_file(tmp); } void TPlanning_mask::create_browse2(TEdit_field& kfld, int level, short key_id, short des_id, const TCodart_livelli &cal) @@ -4045,8 +4045,8 @@ void TPlanning_mask::create_browse2(TEdit_field& kfld, int level, short key_id, TScanner scan(tmp); while (scan.pop() != "EN") kfld.parse_item(scan); - - xvt_fsys_removefile(tmp); + scan.close(); + xvt_fsys_remove_file(tmp); } int TPlanning_mask::create_codart_fields(int x, int y, short key_id, short des_id) diff --git a/mr/mrplib.cpp b/mr/mrplib.cpp index f9b01ccd4..25255c8ff 100755 --- a/mr/mrplib.cpp +++ b/mr/mrplib.cpp @@ -222,15 +222,10 @@ long TMRP_array::sort() { const long last = items()-1; - TProgind* pi = NULL; - if (last >= 16) - pi = new TProgind(last, TR("Ordinamento"), false, true); - else - begin_wait(); - + TProgress_monitor pi(last, TR("Ordinamento"), false); for (long i = 0; i < last; i++) { - if (pi) pi->addstatus(1); + pi.add_status(); TSortable* best = &find_obj(i); bool swapped = true; while (swapped) @@ -248,12 +243,6 @@ long TMRP_array::sort() } } } - - if (pi) - delete pi; - else - end_wait(); - return last+1; } diff --git a/pe/pe0400.cpp b/pe/pe0400.cpp index e0ac5afde..17fe8d432 100755 --- a/pe/pe0400.cpp +++ b/pe/pe0400.cpp @@ -1102,7 +1102,8 @@ TMask* TGestione_preventivo_app::get_mask( int mode ) const int y = m->sh_y() - 1; if (m->var_cost()) - m->add_list(F_TIPO_COSTO, sh.page(), "Tipo costo", 2, y - 1, 20, "", "1|2|4|5|6", "Ultimo costo|Media ultimi costi|Costo standard|Costo medio|Costo medio ponder."); + m->add_list(F_TIPO_COSTO, sh.page(), "Tipo costo", 2, y - 1, 20, "", "1|2|4|5|6", + HR("Ultimo costo|Media ultimi costi|Costo standard|Costo medio|Costo medio ponder.")); m->add_button(F_LOAD_COSTS, sh.page(), "Costi", 66, y - 2, 4, 1, ""); m->set_handler(F_LOAD_COSTS, TGestione_preventivo_msk::pe_update_costi_handler); m->add_button(F_REVISION, sh.page(), "Rev.", 73, y - 2, 4, 1, ""); diff --git a/tc/tc2100.cpp b/tc/tc2100.cpp index 5d49702dc..e47c76a8e 100755 --- a/tc/tc2100.cpp +++ b/tc/tc2100.cpp @@ -99,18 +99,12 @@ TConti_mask::~TConti_mask() // applicazione per la gestione delle tabelle di magazzino class Tab_app_IPSOA : public TTable_module_application { - protected: // TRelation_application virtual bool user_create() ; - -public: - Tab_app_IPSOA() {} - virtual ~Tab_app_IPSOA() {} }; HIDDEN inline Tab_app_IPSOA& app() { return (Tab_app_IPSOA&)main_app(); } - bool Tab_app_IPSOA::user_create() { /* diff --git a/tp/tp0100.cpp b/tp/tp0100.cpp index 7f57c0bbb..700fc0762 100755 --- a/tp/tp0100.cpp +++ b/tp/tp0100.cpp @@ -55,10 +55,7 @@ TPack_iterator::TPack_iterator(TPack_transfer* pt) : _pt(pt), _pi(NULL) const TRecnotype tot = _pt->recordset().items(); TString title; title << _pt->title() << ": " << tot << ' ' << TR("righe"); - if (tot > 1) - _pi = new TProgind(tot, title, true, true); - else - ::begin_wait(); + _pi = new TProgind(tot, title, true, true); if (tot > 0) _pt->log(title); @@ -70,8 +67,6 @@ TPack_iterator::~TPack_iterator() { if (_pi != NULL) delete _pi; - else - ::end_wait(); } ///////////////////////////////////////////////////////////