Jump to content

A.M. Hoornweg

  • Content Count

  • Joined

  • Last visited

  • Days Won


A.M. Hoornweg last won the day on July 18

A.M. Hoornweg had the most liked content!

Community Reputation

115 Excellent

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. A.M. Hoornweg

    inherited dynamic message handlers

    Ah, I've overlooked that! Thanks! One of the reasons I asked is because many of these message handlers in Vcl.Forms are declared private. But apparently, the keyword "private" is meaningless for message methods if they're resolved by number.
  2. Hello all, I have a question regarding dynamic methods in Delphi that handle Windows messages. The documentation is not clear about this. Suppose I declare a Windows message handler in my form like procedure WMNCCreate (var Message: TWMNCCreate); message WM_NCCREATE; with a trivial implementation like procedure WMNCCreate(var Message: TWMNCCreate); begin inherited; end; how is the inherited() call resolved by Delphi? Is it resolved by method name or by message number? In other words, does inherited() call an ancestor's method having the name WMNCCreate, or does it call any method that handles message number WM_NCCreate regardless of the method's name ?
  3. A.M. Hoornweg

    PixelsPerInch property in datamodules and services :-(

    Would it not be necessary to change the DFM file too (change "object" into "inherited") because of this inheritance?
  4. A.M. Hoornweg

    PixelsPerInch property in datamodules and services :-(

    I like the idea, but it would require changing existing projects. Existing datamodules, services and frames would need to inherit from new classes. Maybe it would be more elegant to write a patching unit for older Delphi versions that hooks into the dfm reader and ignores PixelsPerInch.
  5. A.M. Hoornweg

    PixelsPerInch property in datamodules and services :-(

    AFAIK there is no property "scaled" in tService and tDatamodule, so why would the designer need to know PixelsPerInch if it's not supposed to do any scaling? There's "Width" and "Height" so it can still create the window big enough to display the placed components. As a workaround, I've written a command line application that detects if a DFM is tdatamodule or a tservice and if so, removes the "pixelsperinch" property. Maybe I should do the same for tFrame because I intend to always use 96 dpi in design mode. The tool is now integrated in my Finalbuilder build scripts and so far it looks promising. If it is error-free, I may use it inside a pre-commit hook in SVN as well.
  6. Hello all, it is *extremely* annoying that Delphi 11 writes a property "PixelsPerInch" into dfm files of type tDatamodule and tService. Such objects are totally non-visual so what the heck ? This property cause runtime errors when such projects are compiled with Delphi 10 or older. I now have to manually strip it from each and every data module using Notepad!
  7. Hello all, I'm having some trouble debugging DLL's in Delphi 11, trouble which I did not have before in Delphi 10.4. My DLL is compiled in debug mode and has remote debugging symbols. If I specify the host executable (Run-> Parameters -> Debugger -> Host application) and execute the process, breakpoints will not fire in my DLL. But.... if I start the application manually and tell the debugger to attach to the process, breakpoints will fire in the DLL without any problems. This workaround works, but it is super uncomfortable and slows me down. Any idea how I can get the debugging situation back to normal?
  8. I don't mean to compare Pascal to C. I just mean that Delphi has become less usable for low-level modular stuff because the executable size has become so big. Delphi 2009 was the last compiler that created really compact executables.
  9. If Microsoft used Delphi, Windows would be a petabyte in size.
  10. If many units are significantly smaller, it could indicate less inlining, less RTTI overhead, or a much more clever compiler (which would be a sensation). It would be interesting to do a few benchmarks and compare some generated assembly code.
  11. I have no idea, it could be a lot of things. Maybe there's less inlining? Or are they finally using a more compact format for RTTI info? Or maybe LLVM is involved now? Whatever it is, I find the reduction in executable size impressive (I'm a sucker for efficiency). I would be interested to know if x86 code has become tighter also?
  12. Hello World, I just had a pleasant surprise - when I build a certain x64 project of mine, the executable is noticeably smaller under Delphi 11 Alexandria (6.5 MB) than under Delphi 10.4.2 Sydney (7.3 MB). Embarcadero must have done some serious optimizations. (Edit) the project is compiled with {$WEAKLINKRTTI ON}.
  13. A.M. Hoornweg

    How to use unit BufferedFileStream & FastCopy?

    A broken drive is much more costly than the price of the hardware alone. Hard drives *will* fail sooner or later. I have had at least 8 hdd's fail on me in my career. Drop a HDD hard and it's probably ruined (at least I wouldn't ever trust it anymore). If you order a HDD, you have no way of knowing if it was dropped or half frozen during shipping. SSD's OTOH are very insensitive to shocks and temperature differences. No moving parts!
  14. A.M. Hoornweg

    How to use unit BufferedFileStream & FastCopy?

    David asked "What's wrong with". So I pointed out some. OP may have other reasons, admittedly. 🙂
  15. A.M. Hoornweg

    How to use unit BufferedFileStream & FastCopy?

    I avoid it for the following reasons. First of all, the CopyFileEx API documentation does not specify if the source file is opened for shared access or not. So I don't know how it behaves when multiple users are accessing the file and if that behavior may change in future. Secondly, when I copy a file somewhere, I emphatically want it to inherit the access properties of the target directory. Otherwise the access rights become unpredictable. Unfortunately, the CopyFileEx API documentation says "The security resource properties (ATTRIBUTE_SECURITY_INFORMATION) for the existing file are copied to the new file". I really don't want that to happen.