From 4ab2626121cf151305fbb1a71f503ca06fe946a5 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 21 Jul 1999 09:18:16 +0000 Subject: [PATCH] Patch level : xx.502 Files correlati : Ricompilazione Demo : [ ] Commento : Correzzioni al merge git-svn-id: svn://10.65.10.50/trunk@8412 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/applicat.cpp | 2 ++ include/archives.h | 5 ++- include/dongle.cpp | 4 +-- include/dongle.h | 1 - include/expr.cpp | 1 - include/isam.cpp | 11 ++---- include/isam.h | 2 -- include/mask.cpp | 21 +++-------- include/os_win16.cpp | 3 +- include/os_win32.cpp | 84 ++++++++++++++++++++++++++++++++++++++++++++ include/postman.h | 2 +- include/relapp.h | 2 +- include/relation.cpp | 15 ++++---- include/strings.cpp | 4 +-- include/xvtility.cpp | 8 +++-- 15 files changed, 115 insertions(+), 50 deletions(-) diff --git a/include/applicat.cpp b/include/applicat.cpp index 578043d9d..c101a7116 100755 --- a/include/applicat.cpp +++ b/include/applicat.cpp @@ -1,3 +1,5 @@ +#define STRICT +#define XVT_INCL_NATIVE #include #include #include diff --git a/include/archives.h b/include/archives.h index b24a5d8c7..7697d70f8 100755 --- a/include/archives.h +++ b/include/archives.h @@ -36,9 +36,6 @@ class TArchive : public TObject // corretta sequenza dei dischetti da inserire FILE* ask_disk(TFilename& name, int disk, char floppy, bool lettura) const; - // @cmember Scrive il file backup.ini sul drive indicato - bool write_ini(TFilename& name, int disk, long tot, const char* desc, char floppy) const; - // @cmember Spezza il file in modo da farlo stare sul dischetto bool fsplit(const char* filename, char floppy, const char* desc = "") const; // @cmember Ricostruisce il file spezzato @@ -59,6 +56,8 @@ protected: // @cmember Ricostruisce la lista dei file contenuti nel backup int build_backup_list(long firm, TString_array& fl) const; + // @cmember Scrive il file backup.ini sul drive indicato + bool write_ini(TFilename& name, int disk, long tot, const char* desc, char floppy) const; // @cmember Costruisce la lista delle directory da scompattare int build_restore_list(long firm, char floppy, TString_array& fl) const; diff --git a/include/dongle.cpp b/include/dongle.cpp index 2537576f9..41f3ef395 100755 --- a/include/dongle.cpp +++ b/include/dongle.cpp @@ -443,10 +443,10 @@ bool TDongle::eutron_login(bool test_all_keys) // Calcola il numero della word dove cominciano i bit di attivazione unsigned short otb = eh->_offset_to_bits; - if (otb == 0) otb == 16; // Compatibile Hardlock + if (otb == 0) otb = 16; // Compatibile Hardlock unsigned short sob = eh->_size_of_bits; - if (sob == 0) sob == 16; // Compatibile Hardlock + if (sob == 0) sob = 16; // Compatibile Hardlock word data[64]; if (read_words(otb, sob, data)) diff --git a/include/dongle.h b/include/dongle.h index cd6fb95f9..ca162b31b 100755 --- a/include/dongle.h +++ b/include/dongle.h @@ -26,7 +26,6 @@ class TDongle : public TObject TBit_array _module; bool _dirty; - TString16 _admin, _admpwd; TDate _last_assist; unsigned long _assist[MAX_DONGLE_ASSIST]; // Centesimi di Euro pre-pagati diff --git a/include/expr.cpp b/include/expr.cpp index 676f18b1f..80b2296ce 100755 --- a/include/expr.cpp +++ b/include/expr.cpp @@ -116,7 +116,6 @@ const TString& TVararray::getstring(int varnum) NFCHECK("Invalid variable number : %d", varnum); return EMPTY_STRING; } - TVar* var = (TVar*)objptr(varnum); return var->string(); } diff --git a/include/isam.cpp b/include/isam.cpp index 78fe99d2c..37c3bf454 100755 --- a/include/isam.cpp +++ b/include/isam.cpp @@ -618,7 +618,6 @@ void set_autoload_new_files( TBaseisamfile::TBaseisamfile(int logicnum) { - CHECK(openrec, "This applications lies, it really do use files!"); _logicnum = logicnum; _isam_handle = 0; _curr_key = 0; @@ -869,7 +868,6 @@ int TBaseisamfile::_write(const TRectype& rec) if (_lasterr == NOERR) { - notify_change(); #ifdef JOURNAL if (get_journal()) { @@ -923,7 +921,6 @@ int TBaseisamfile::_rewrite(const TRectype& rec) _lasterr = DB_rewrite(fhnd); if (_lasterr == NOERR) { - notify_change(); #ifdef JOURNAL if (get_journal()) { @@ -993,7 +990,6 @@ int TBaseisamfile::_remove(const TRectype& rec) _lasterr = DB_delete(fhnd); // Put only deletion flag on record, must remove keys too! if (_lasterr == NOERR) { - notify_change(); DB_flush(fhnd); #ifdef JOURNAL if (get_journal()) @@ -1079,7 +1075,6 @@ int TBaseisamfile::_open( // @flag FALSE | Il file viene aperto senza indici { -<<<<<<< isam.cpp CHECKD(_isam_handle == 0, "Can't reopen file ", _logicnum); _curr_key = index ? 1 : 0; @@ -1457,8 +1452,8 @@ int TIsamtempfile::open( filename.ext("dbf"); if (err == -60) { - if (access(n,0)) // check for existence - fatal_box("Apertura file %s : errore n. %d. File non esistente.",(const char*) n,err); + if (access(filename,0)) // check for existence + fatal_box("Apertura file %s : errore n. %d. File non esistente.",(const char*) filename,err); else fatal_box("Apertura file %s : errore n. %d. File aperto in uso esclusivo da un'altra applicazione.",(const char*)filename,err); } @@ -1511,7 +1506,7 @@ int TIsamtempfile::close() } ::remove(f); - if (rec_has_memo(filehnd()->r)) // Cancella eventuale file dei memo + if (curr().has_memo()) // Cancella eventuale file dei memo { f.ext("fpt"); ::remove(f); diff --git a/include/isam.h b/include/isam.h index 608e6d867..502d12f8c 100755 --- a/include/isam.h +++ b/include/isam.h @@ -498,8 +498,6 @@ public: virtual bool get_relapp(TString& app) const; - // @cmember Testa se il file e' cambiato dal ciclo di clock

- bool is_changed_since(long clk) const; // @cmember Testa se il file e' cambiato dal momento

bool is_changed_since(long& stat) const; diff --git a/include/mask.cpp b/include/mask.cpp index c07f92cbe..7a4042ec2 100755 --- a/include/mask.cpp +++ b/include/mask.cpp @@ -559,17 +559,6 @@ TEdit_field& TMask::efield(short id) const return (TEdit_field&)f; } -int TMask::sheets() const -{ - int count = 0; - for (int f = fields()-1; f >= 0; f--) - { - if (fld(f).is_sheet()) - count++; - } - return count; -} - TSheet_field& TMask::sfield(short id) const { TMask_field& f = field(id); @@ -865,14 +854,14 @@ TMask_field* TMask::parse_field(TScanner& scanner) } int TMask::sheets() const -{ - int s = 0; +{ + int count = 0; for (int f = fields()-1; f >= 0; f--) { - if (fld(f).is_kind_of(CLASS_SHEET_FIELD)) - s++; + if (fld(f).is_sheet()) + count++; } - return s; + return count; } // @doc EXTERNAL diff --git a/include/os_win16.cpp b/include/os_win16.cpp index 5e1b5237e..9ccd27a5a 100755 --- a/include/os_win16.cpp +++ b/include/os_win16.cpp @@ -107,7 +107,8 @@ HIDDEN BOOLEAN event_hook(HWND hwnd, bool os_allow_another_instance() { - return TRUE; + NFCHECK("Bisogna implementare la allow_another_instance"); + return TRUE; } COLOR os_choose_color(COLOR col, WINDOW win) diff --git a/include/os_win32.cpp b/include/os_win32.cpp index 4a906b2bb..a015eb8aa 100755 --- a/include/os_win32.cpp +++ b/include/os_win32.cpp @@ -536,3 +536,87 @@ bool os_dongle_server_running() ATOM a = GlobalFindAtom("DONGLE_SERVER_ATOM"); return a != 0; } + +HIDDEN const char* _file_to_find = NULL; + +struct TFindWindowInfo +{ + HINSTANCE _instance; + TFilename _file; + HWND _hwnd; + + TFindWindowInfo() : _instance(NULL), _hwnd(NULL) { } +}; + +BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam) +{ + TFindWindowInfo* w = (TFindWindowInfo*)lParam; + + HINSTANCE inst = (HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE); + if (inst == w->_instance) + { + const LONG style = GetWindowLong(hwnd, GWL_STYLE); + if ((style & WS_CAPTION) != 0) // Ha la caption? + { + w->_hwnd = hwnd; + return FALSE; + } + return TRUE; + } + + TString256 str; + GetWindowText(hwnd, str.get_buffer(), str.size()); + str.upper(); + if (str.find(w->_file) >= 0) + { + w->_hwnd = hwnd; + return FALSE; + } + + return TRUE; +} + +unsigned long os_execute_in_window(const TFilename& path, WINDOW win) +{ + const unsigned long exitcode = WinExec(path, SW_SHOWNORMAL); + if (exitcode < 32) + return 0; + + TFindWindowInfo w; + w._instance = (HINSTANCE) exitcode; + + const int space = path.find(' '); + if (space > 0) + w._file = path.mid(space+1); + else + w._file = path; + w._file = w._file.name(); + w._file.ext(""); + w._file.upper(); + + const clock_t start = clock(); + while (w._hwnd == NULL && (clock() - start) < 10*CLOCKS_PER_SEC) + { + xvt_app_process_pending_events(); + EnumWindows(EnumWindowsProc, LPARAM(&w)); + } + + if (w._hwnd != NULL) // L'ho trovata! + { + RCT rct; xvt_vobj_get_client_rect(win, &rct); + HWND nat = (HWND)xvt_vobj_get_attr(win, ATTR_NATIVE_WINDOW); + SetParent(w._hwnd, nat); +// LONG style = GetWindowLong(w._hwnd, GWL_STYLE); +// style |= WS_CHILD; +// SetWindowLong(w._hwnd, GWL_STYLE, style); + const int fx = GetSystemMetrics(SM_CXFRAME); + const int fy = GetSystemMetrics(SM_CYFRAME); + int cy = GetSystemMetrics(SM_CYCAPTION)+GetSystemMetrics(SM_CYBORDER); + if (GetMenu(w._hwnd) != NULL) + cy += GetSystemMetrics(SM_CYMENU); + SetWindowPos(w._hwnd, nat, -fx, -fy-cy, rct.right+2*fx, rct.bottom+cy+2*fy, SWP_NOZORDER); + } + + return (unsigned long) w._hwnd; +} + diff --git a/include/postman.h b/include/postman.h index 2df5ac1d7..c2fe9b226 100755 --- a/include/postman.h +++ b/include/postman.h @@ -26,4 +26,4 @@ bool user_can_read(const TRelation* rel); bool user_can_write(const TRelation* rel); #endif -======= + diff --git a/include/relapp.h b/include/relapp.h index 66574c88a..a8b02d4f2 100755 --- a/include/relapp.h +++ b/include/relapp.h @@ -67,7 +67,7 @@ class TRelation_application : public TSkeleton_application // @cmember:(INTERNAL) Modalità di esecuzione della transazione corrente (Automatica o interattiva) char _curr_trans_mode; // @cmember:(INTERNAL) Flag di cancellazione automatica veloce - bool _autodelete; + int _autodelete; private: // @cmember:(INTERNAL) Carica la transazione corrente (protocollo via .ini) diff --git a/include/relation.cpp b/include/relation.cpp index 21ec3b1dd..58b35d406 100755 --- a/include/relation.cpp +++ b/include/relation.cpp @@ -1002,7 +1002,6 @@ TRecnotype TCursor::buildcursor(TRecnotype rp) const bool filtered = has_filter(); TRecnotype* page = new TRecnotype [CMAXELPAGE]; -<<<<<<< relation.cpp // TRecnotype pos = DB_index_recno(handle); // pos = DB_index_recno(fhnd); _pos = -1; @@ -1011,14 +1010,12 @@ TRecnotype TCursor::buildcursor(TRecnotype rp) while (TRUE) { - if (DB_index_eof(fhnd)) break; - const char* s0 = DB_index_getkey(fhnd); - if (l && (strncmp(to(), s0, l) < 0)) break; - const TRecnotype recno = DB_index_recno(fhnd); - if (recno == oldrecno) break; // means that no more keys are available - oldrecno=recno; + if (DB_index_eof(handle)) break; const char* s0 = DB_index_getkey(handle); if (l && (strncmp(to(), s0, l) < 0)) break; + const TRecnotype recno = DB_index_recno(handle); + if (recno == oldrecno) break; // means that no more keys are available + oldrecno=recno; if (pagecnt == CMAXELPAGE) { if (filtered && !simple_filter) @@ -1047,10 +1044,10 @@ TRecnotype TCursor::buildcursor(TRecnotype rp) else page[pagecnt++] = recno; - DB_index_next(fhnd); + DB_index_next(handle); int rt=get_error(-1); if (rt != NOERR) - fatal_box("Can't read index n. %d - file n. %d",DB_tagget(file().filehnd()->fhnd),file().filehnd()->ln); + fatal_box("Can't read index n. %d - file n. %d", DB_tagget(handle), file().num()); } // while if (pagecnt) { diff --git a/include/strings.cpp b/include/strings.cpp index 787ce6f1d..df373903d 100755 --- a/include/strings.cpp +++ b/include/strings.cpp @@ -98,10 +98,10 @@ void TString512::strncpy(const char* s, int n) } #ifdef FOXPRO -HIDDEN TString512 spark; +HIDDEN TString512 _spark; #else HIDDEN TString512* ptr_spark = new TString512; -HIDDEN TString512& spark = *ptr_spark; +HIDDEN TString512& _spark = *ptr_spark; #endif inline bool is_space(char c) diff --git a/include/xvtility.cpp b/include/xvtility.cpp index c6d05a1c6..aa74f2406 100755 --- a/include/xvtility.cpp +++ b/include/xvtility.cpp @@ -1,3 +1,5 @@ +#define STRICT +#define XVT_INCL_NATIVE #include #include #include @@ -386,9 +388,9 @@ void customize_controls( { if (on) { -#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_WIN32 - HInstance = (HINSTANCE)xvt_vobj_get_attr(NULL_WIN, ATTR_WIN_INSTANCE); -#endif +//#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_WIN32 +// HInstance = (HINSTANCE)xvt_vobj_get_attr(NULL_WIN, ATTR_WIN_INSTANCE); +//#endif customize_colors(); init_controls(); }