Jump to content

aehimself

Members
  • Content Count

    1090
  • Joined

  • Last visited

  • Days Won

    23

Posts posted by aehimself


  1. 42 minutes ago, Keesver said:

    This is a clustermess. If you are publishing to Android you must have an update subscription so you can continue to be present; but even if you do you’ll do it on a beta platform which might not produce fully functioning code…? Am I getting it right…?

     

    Fortunately I’m not affected it; it just sounds extremely strange. I did not check the article but I’m sure the steps needed could be automatized and depleted via a patch.


  2. According to the stack trace it is indeed GDI object exhaustion. Check where and how you are manipulating images and make sure you are disposing of them properly.

    We had this when there was an image list on a frame which was created thousands of times. Moving the imagelist to a common place solved our issue immediately.

     

    @Dalija Prasnikar we also received EOutOfResources when our application used up all available user handles so it’s not strictly GDI-related. But yes, leaking handles often pop up as Delphi classes in the memory leak report.


  3. Yes, it should be ListView1.Items.Add.

     

     If you declared your class like I posted (descending from “nothing” = TObject) it does not require an owner (not a parent).

    If the definition is correct, it’s still possible that the RTL has a component named TListItemData, so you can try to name yours “TMyListItemData” or something else - that will help the compiler to recognize which one you want to create and what parameters it requires.


  4. It's not working with a global variable because you cannot make sure that it has the right value the moment the ListItem (re)draws an item (e.g. during scrolling). Instead, you have to tie this data to each independent node. Declare a type, e.g.:

    TListItemData = Class
    public
      BoldText: Boolean;
    End;

    Then, when adding a list item:

    var li := ListItem1.Items.Add;
    li.Data := TListItemData.Create;
    (li.Data As TListItemData).BoldText := True;

    To make sure you are not leaking memory, add an OnDeletion handler to your ListView:

    If Assigned(Item) Then
    Begin
      TListItemData(Item.Data).Free;
      Item.Data := nil;
    End;

    After all this, in your custom draw methods you can check the object's property:

    If Assigned(Item.Data) And (Item.Data As TListItemData).BoldText Then
      Sender.Canvas.Font.Style := [fsBold]
    Else
      Sender.Canvas.Font.Style := [];

    I did not run this code so some minor adjustments might be needed but the basics are this.

    Also, instead of a custom class you simply can create and assign a PBoolean to Node.Data, but a class is more versatile if you want to add more properties later on.


  5. When you open the site in your browser you can check all the network calls made for the site to actually load. If you are lucky there will be an API call which returns the file list in a well-known format.

     

    Even if there is one, I don’t know however if you are allowed to query that API… the site owner will be able to tell you the legal parts.

    • Like 1

  6. In your browser it works because there are some JavaScript generating / fetching the data from somewhere else with your browser happily renders.

    You’ll need TEdgeBrowser or something similar to actually render it for you and then process the visible document.

    • Like 1

  7. 1 minute ago, Stano said:

    I have: amTranslationManagerInstall-2.0.8370.39904 - year 2019 
    So I went through it. I have understood/figured out where and how to get to the filters. How the filters and Find work.
    I searched for pumAutoIns from:

     

    LocNavigator unit;

    resourcestring
      pumAutoIns = 'Automatically insert the next record';

     

    Unfortunately, it's not there :classic_unsure:

    Resource strings are prefixed with the unit name they are in; so it should be named LocNavigator_pumAutoIns

    It must be there. Never met any resource string left out by BTM.


  8. Including the checks if a specific branch exists or not, you also can use the built-in System.Json unit:

    Var
      jo, coinmech: TJSONObject;
      recenum, tubeenum: TJSONValue;
      records, tubes: TJSONArray;
    begin
      jo := TJSONObject(TJSONObject.ParseJSONValue(Memo1.Text));
    
      If Not Assigned(jo) Then
        Exit;
    
      Try
        records := jo.GetValue<TJSONArray>('records');
    
        If Not Assigned(records) Then
          Exit;
    
        For recenum In records Do
        Begin
          coinmech := recenum.GetValue<TJSONObject>('coin_mech');
    
          If Not Assigned(coinmech) Then
            Continue;
    
          tubes := coinmech.GetValue<TJSONArray>('tubes');
    
          If Not Assigned(tubes) Then
            Continue;
    
          For tubeenum In tubes Do
          Begin
            WriteLn('Tube found, ID:' + tubeenum.GetValue<String>('tube_id'));
            // ...
            // Add a new record in a MemTable...?
          End;
        End;
      Finally
        FreeAndNil(jo);
      End;

    The code can be siplified significantly but this way you can see what is happening, how TJSONObject handling works. The code above produced the following output:

    image.thumb.png.840155cde934a6c0f89996b4cd61047f.png


  9. Short answer: never.

     

    Long answer: there are always code breaking changes in code or in protocols which will make older applications to be unable to communicate with never versions.

    This is why - if you really can not upgrade - we are using virtual machines with legacy OS-es hosting legacy applications.

     

    As ESXi is free you can also have your “museum” built this way but be aware that these legacy systems are usually extremely vulnerable to attacks in todays world.

    • Like 1

  10. I am using DCPCrypt in 64 bit applications without any issues but I remember that I had to dig for a package as there was one which didn’t compile.

     

    I’ll check later today which version I’m using and where exactly I downloaded it from.

     

    Edit: ReadMe simply say I'm too using v2 but I cannot find any reference to the sub version number. I still need to confirm this somehow but I think I'm using the SourceForge version.

     

    Do you have a code snipplet which fails to compile or it's the package itself?

     

    Edit-edit: my archive which has the source is called "dcpcrypt-code-r16-trunk.zip". So I'm pretty sure it's the SourceForge version 🙂


  11. 18 hours ago, TazKy said:

    I put the blame on DevExpress because I dislike the whole product and perhaps too quickly laid the blame on it.

    Thats very subjective, isn’t it? 🙂

     

    DevExpress indeed slows down Delphi - which is perfectly normal as it adds hundreds of components to the palette. But in my experience this only affects the load time of the IDE itself, not the appearance of your first form / unit on the screen!

     

    Which one you have an issue with?

×