Jump to content

alogrep

Members
  • Content Count

    157
  • Joined

  • Last visited

Posts posted by alogrep


  1. Thanks Remy Lebeau.

    What do you mean by "debugging the RTL source code"? My own code  here?

    try
                  TTCPEchoThrd.create(ClientSock);
    except
     on E:SysUtils.Exception do begin
       showmessage('Thread creation error:  '+E.message);
     end;
    end;

    Or does that mean the RTL Dephi code? If so, how can I find  where the thread failure happens? 


  2. Hi.

    Doe anyone have experienced this erro?

    It just says Thread creation error:

    with NOTHING shown after the 2 dots. 

    Mayvbe is a ghost error?

    Thi is my code 

     if lastError=0 then  begin
      prognum:=prognum+1;
    try
      TTCPEchoThrd.create(ClientSock,prognum);
    except
      on E:SysUtils.Exception do begin
       showmessage('prognum ='+inttostr(prognum)+' '+E.message);
      end;
    end;

     


  3. Hi.

    I have this simple code, where the except block is not entered;

     n:=0;
      try
      d:=100/n;
      except
          on E:system.SysUtils.Exception do
            showmessage(e.message);
      end;
    I attached the Options->tools configuration and the Project'sone.
    May I did something foolish, I uninstalled Madacept with revo Uninstaller, before removing it from the 
    IDE packages?
    Any way to repair this problem?

    debugger.jpg

    compile.jpg

    linking.jpg


  4. type
      name_struct= record
       fname: string;
       lname : string;
    end;
    arec= record
       names : array of name_struct ;
       age: array of integer;
    end;
    
    type
    records = array of arec;
    
    setlength(records,100);
    for x :=0 to 99 do
      load each records[x]
    When I do
      records:=Nil, does it free all "names" (and fname, lname) of all recs as well as the recods array itself?

  5. I received a message from vcl.dialogs that sai=ys something about a criticalsection conflict (unfortunately I did not write  down the message, and is hard to reproduce. It happend twice, then in a dozen trials doing the identical steps it did not show up).
    I have a Tcriticalsection instance defined in one of my units and it is used in a thread, but it is always used in a acquaire/release pair in a try/finally block.
    This happened in the IDE, where I have some breakpoints and I stopped the execution for several seconds.

  6. HI.
    I can't understand why Madexcept shows a leak on FIndFirst/FindClose.
    THis is what I have :
    type
      SendThread = class(TThread)
      private
       CriticalSection: TCriticalSection;
       fmods:modslist;
       tablename: string;
       savedir: string;
       dbase: string;
       uniq: integer;
      public
        Constructor Create(afmods:modslist; atablename: string;uniquenumber: int64;asavedir,adbase: string);
        Destructor Destroy; override;
        procedure Execute; override;
        procedure Fields2sTREAM(fmods:modslist; tablename: string; dbase: Tnxdatabase);
      end;

    CriticalSection is created in the Create constructor and free-d in Destroy.

    In the Execute, I have this.

     CriticalSection.Acquire;
     try
       s:=savedir+'\*'+lowercase(dm2.uniquenumber.tablename)+'.db';
       if findfirst(s,faAnyFile,sr)=0 then  begin
         Deletefile(savedir+'\'+sr.name);
         FindClose(SR);
       end;
       s:=Format('%.*d',[13, uniq]);
       s:= savedir+'\'+s+'$pos-'+lowercase(dm2.uniquenumber.tablename)+'.db';
       sStream.savetofile(s);
     finally
       CriticalSection.Release;
     end;

    Any clue anybody?


  7. Hi.

    I found these 3 lines thata semm VERY suspicious to me in Processmonitor. Is there something wrong with my delphi 12 installations?

    04:14:27.0519775 p. m.    Explorer.EXE    9964    RegQueryValue    HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\C:\Program Files (x86)\Embarcadero\Studio\23.0\bin\bds.exe    NAME NOT FOUND    Length: 16

    04:14:27.0526399 p. m.    Explorer.EXE    9964    CreateFileMapping    C:\Program Files (x86)\Embarcadero\Studio\23.0\bin\bds.exe    FILE LOCKED WITH ONLY READERS    SyncType: SyncTypeCreateSection, PageProtection: PAGE_EXECUTE_READ

    04:14:27.0902689 p. m.    Explorer.EXE    9964    CreateFileMapping    C:\Program Files (x86)\Embarcadero\Studio\23.0\bin\bds.exe.config    FILE LOCKED WITH ONLY READERS    SyncType: SyncTypeCreateSection, PageProtection: PAGE_EXECUTE_READ
     


  8. HI

    In the following code I put 2 breakpoints at the beginning of Thread.Create and of Thread.Destroy.

    I noticed that in all cases except one the sequence Crate/Destroy is executed in the correct order.

    But in one case, Destroy is called twice in a row.

    Does anybody have an idea as to why? 

    Constructor SendThread.Create(afmods:modslist; atablename: string;uniquenumber: int64;asavedir,adbase: string);
    begin
      inherited create(false);
      FreeOnTerminate:=true;
      fmods:=afmods;
      tablename:=atablename;
      uniq:=uniquenumber;
      dbase:=adbase;
      savedir:=asavedir;
      sstream:=TStringstream.create;
    
    end;
    
    Destructor SendThread.Destroy;
    begin
      sstream.free;
      inherited Destroy;
    end;
    
    procedure SendThread.Execute;
    var
      s,last1: string;
      l,i,n,modindex: integer;
      done: boolean;
      t: textfile;
    begin
       if length(fmods)<=0 then
         exit;
     modindex:=getmodindex(inttostr(uniq),fmods);
     with fmods[modindex] do begin
    // s:=format('%-11s',[fmods[high(fmods)].val]);
    // sStream.writestring(s);
      for l:=0 to high(mods) do begin
        sstream.writestring(format('%4s',[inttostr(mods[l].fieldpos)]));
        sstream.writestring(format('%10d',[length(mods[l].val)]));
        sStream.writestring(mods[l].val);
      END;
      mods:=Nil;
     end;
     sStream.position:=0;
     s:=Format('%.*d',[13, uniq]);
     s:= savedir+'\'+s+'$'+trim(copy(dbase,Lastdelimiter('\',dbase)+1,10))+'-'+tablename+'.db';
     sStream.savetofile(s);
     last1:=inttostr(Lastuniquenumber);
     sStream.clear;
     sstream.writestring(format('%4s',['0']));
     sstream.writestring(format('%10d',[length(last1)]));
     sStream.writestring(last1);
     s:=Format('%.*d',[13, uniq]);
     s:= savedir+'\'+s+'$pos-'+tablename+'.db';
     sStream.savetofile(s);
    end;
    

     


  9. HI

    I installed nexusdb into Delphi 12, and I got the error shown in the jpg attached.

    Nexusdb asked me to uncheck the package in Install Packages and see what happens.

    I guess that was to decide if the error was a Nexus one or a Delphi one.

    But when I uncheck the package, the check mark disappears alright, I press OK, restart the 

    IDE , I get the same error and the package is still CHECKED.

    Somebody can help with this? Is there a  manual way to ensure the unchecked package 

    remains unchecked? 

     

    error3.jpg


  10. Hola Peter (not Paul!) Below😀.

    What happend:  there was a power failure. I exit the IDE (saving wip).  The PC was "shutting down" but the UPS ran out of battery before the shutting down terminated. Now the .pas file I am interested in is full of 

    '0' (checked with a binary file viewer. The history shws the file and the Buffer both empty.

    Withe the old system, the ~pas file that had been saved previusly, I would have lost the .pas and the wip,

    but I could have retrieved the .~pas. Here, I lost everything. 


  11. Sorry, Uwe.
    I guess I should not run installations at four O'Clock in the morning.
    No, I did not delete nor "touch" anything.
    As soon as the installation terminated I did the test program.
    I checked the Library and it showed the attached (lib.jpg). Luckily I still have my Delphi 11 installed and so I copied the library path from there and so far it seems it works.
    BUt even this new version does not create the '~pas backup file. What I mean, since the beginning (D5) until a month ago every time I modified sayUnit2.pas, when I saved it, Delphi created Unit2.~pas . This feature stopped. Do you have any idea as to how can I reactivate it?

    lib.jpg


  12. Roger, sorry. I am talkng about this: since Delphi 5, everytime I saved a pas/dfm u nit, it would create a ~pas/~dfm AUTOMATICALlY.

    I did not have to go to _history (or _math), no, where the pas was, the ~pas was created.

    In the last couble of months this stopped happening. How Do I reestore taht useful feature?

     


  13. Good  Morning
    I paid subscription renewal, ia download and installed delphi 12.0
    I test a VCL program with one button, onclick = showmessage('Hello');
    It blows my mind when I see "[dcc32 Error] E1026 File not found: 'Controls.res'
    Embarcadero, can you please do your (paid work)???
     Why do I have to spend days fixing your bugs? 
    Sorry, I am angry YES, but on every upgrade I find problems! 
    Can you test your installation app maybe 20 or 30 times before selling it to me and others"?
    Anyway if there is a good soul that care to give me a clue as to what do, I would I appreciate it./

  14. Thanks both. I did check "Create backup files" But it did not crate   a "*.~pas .

    I changed unit3a.pas, sdaved the chage, and whe  I look in DOS i see 

     Directory of C:\hm\posdev

    24/03/2023  09:01 p. m.           111,252 unit3a.~pas

    but I changed today: 08 Jan 2024!!!!

×