Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 07/05/25 in all areas

  1. DelphiUdIT

    Posix source files missing

    My sources about Posix are in "C:\Program Files (x86)\Embarcadero\Studio\23.0\source\rtl\posix" If you have trouble compiling, look at: https://docwiki.embarcadero.com/RADStudio/Athens/en/Installation_Notes There are some notes about Linux at the end of the page (missing lib paths). P.S.: in my installations of course there are the compiled units in ALL needed paths.
  2. mjustin

    Profiling Tools for Delphi Apps?

    https://www.delphitools.info/samplingprofiler/ "SamplingProfiler is a performance profiling tool for Delphi, from version 5 up to both 32bits & 64bit Delphi 12.x (and likely the next ones). Its purpose is to help locate bottlenecks, even in final, optimized code running at full-speed." ... "With version 1.7+, SamplingProfiler includes a small http web server which can be used for real-time monitoring of the profiled application. The monitor provides code hot-spot information in real-time, in HTML or XML form."
  3. Debugging and tracking the OnChecked event, the behavior has nothing to do with Delphi and its VCL, it is triggered by Windows message, so you have to use a workaround about that, something like what Remy suggested.
  4. You are right the the behavior is wrong and buggy, Using similar approach of create then add, doesn't show caption, but no memory leak on XE8.
  5. I tried this var Item := TListItem.Create (ListView1.Items); Item.Caption := SomeLinkedObject.Name; Item.Checked := SomeLinkedObject.Enabled; Item.Data := SomeLinkedObject; ListView1.Items.AddItem (Item); but the item is shown without caption!, and memory leak occurred! --------------------------- Unexpected Memory Leak --------------------------- An unexpected memory leak has occurred. The unexpected small block leaks are: 13 - 20 bytes: TList x 4, Unknown x 4 21 - 28 bytes: UnicodeString x 3 37 - 44 bytes: UnicodeString x 1 45 - 52 bytes: TListItem x 4 77 - 84 bytes: TSubItems x 4 I don't think solves the issue since the only way to implement your suggestion is to use ListView.Items.AddItem which is called by ListView.Items.Add.
  6. But, it is already created, initialized (with default) and added with ListView1.Items.Add Your next Item.Checked := SomeLinkedObject.Enabled; Is triggering the event as designed, nothing wrong here, If you don't want that behavior, then try to create the item as local var, not by calling Items.Add then set (Initialize) properties and only then add it to the items, though i am not sure if this will trigger the event or not, it shouldn't, but who knows you need to test it, this will change the narrative of the expected behaviour and might, i say might, be discussed as bug or short in design, if just adding an item triggers an event.
  7. The checkboxes are implemented as state images. You are getting the event when the item's initial state is assigned. Just check for the nil condition and don't access the object when it's not ready yet: procedure TForm1.ListView1ItemChecked(Sender: TObject; Item: TListItem); begin if Assigned(Item.Data) then TSomeLinkedObject(Item.Data).Enabled := Item.Checked; end; Alternatively, disable the event when adding an item, and then re-enable the event when ready: ListView1.OnItemChecked := nil; var Item := ListView1.Items.Add; ... ListView1.OnItemChecked := ListView1ItemChecked;
  8. Short answer: Yes Long answer: Yes, but don't! It would put your SQL database at risk. Instead, build a proper REST API as - it hides the underlying database - it allows you to change the underlying database operations without changing the client A REST API done right is far more secure and robust.
×