Jump to content

A.M. Hoornweg

Members
  • Content Count

    446
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by A.M. Hoornweg

  1. 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?
  2. A.M. Hoornweg

    Parnassus Bookmarks for Delphi 11 Alexandria?

    It's been four months since this thread was created, still no bookmarks tool in sight 😞
  3. A.M. Hoornweg

    tImagecollection, how to improve downscaling?

    Hello all, I have a tImagecollection with square transparent PNG images at 256x256 size which I want to downscale smoothly. The collection's interpolation mode is set to icIMModeHighQualityCubic. I notice that tVirtualImage gives much smoother image quality at 32x32 than tImage if I manually downscale the image using tImageCollection.GetBitmap(). I would very much like to get to the bottom of this. This is the code I use to manually extract and downscale an image from tImagecollection. Parameter "Targetimage" is just a TImage on some TPanel on a TForm. Am I doing something wrong? procedure LoadImageFromCollection(TargetImage: tImage; ImageName: string; Collection: TImageCollection; DesiredHeight: Integer); var tb: tbitmap; h,idx: Integer; begin idx := Collection.GetIndexByName(ImageName); if idx > -1 then begin h:=desiredHeight; if TargetImage.AlignWithMargins then h := h - TargetImage.Margins.Top - TargetImage.Margins.Bottom; TargetImage.Height := h; TargetImage.width := h; TargetImage.Transparent := True; tb := Collection.getbitmap(idx, h, h); try tb.AlphaFormat := afDefined; TargetImage.Picture.Bitmap.Assign(tb); finally tb.free; end; end; end;
  4. A.M. Hoornweg

    tImagecollection, how to improve downscaling?

    Thank you! Now it works !
  5. Hello all, I am using tImageCollection and tVirtualImageList inside a COM DLL to display some images on buttons etc. This COM DLL is an update to an existing version - the calling processes are existing programs, many of which were compiled with older Delphi versions. I'm observing a very strange phenomenon: the images on the buttons in the DLL are not displayed if the calling executable does not have a manifest. They are only displayed if the calling executable has a manifest. I find no reference in the Delphi documentation that tImageCollection has manifest requirements. Can anyone shed some light on this? My reason for asking: I cannot update the existing legacy applications with a new manifest - they are digitally signed and inserting a new manifest would break the signature..
  6. A.M. Hoornweg

    tImageCollection in COM DLL - EXE needs manifest ???

    Interesting! I'll take a good look at that, thanks for pointing it out!
  7. A.M. Hoornweg

    tImageCollection in COM DLL - EXE needs manifest ???

    Oww, that sounds like a pain. But I think it should be possible to just pack a manifest alongside an existing application, without embedding it and damaging the digital signature?
  8. A.M. Hoornweg

    tImageCollection in COM DLL - EXE needs manifest ???

    The problem isn't tImageList related - the DLL used tImageList in the past without problems or manifest requirements until I replaced it with tImageCollection & tVirtualImageList. Also, the operating system is Windows 10, so comctl32 on the system is most certainly the current version. By the way, with a properly manifested application, the new icons display correctly even on Windows XP which is vintage so I don't think it's a matter of an outdated comctl32. ( edit: I compiled the test application under Delphi 11 fixpack 1 with {$SETPEOSVERSION 5.1} {$SETPESUBSYSVERSION 5.1} to make it work on XP).
  9. A.M. Hoornweg

    Developing under Windows 11 in a VM not feasible ?

    Sure. Until that time, I'll just stick with Windows 10 in the VM.
  10. A.M. Hoornweg

    Developing under Windows 11 in a VM not feasible ?

    One simple workaround is to run Delphi inside a VMWare VM and to configure that VM so, that its resolution is 1920x1080 and "stretched". That way Delphi will run at a resolution of 2K even though the monitor really has a much higher resolution. As for DPI awareness in compiled Delphi applications themselves, I have a whole bunch of workarounds to make things work better. The key for me was to inherit every TForm from a common ancestor and to override some virtual methods in that ancestor (DoBeforeMonitorDPIChanged, DoAfterMonitorDPIChanged, Loaded, Docreate and some more ...) to fix the most egregious bugs. That way any form derived from that common ancestor behaves much better.
  11. A.M. Hoornweg

    Developing under Windows 11 in a VM not feasible ?

    That workaround is well known, but it'll probably cease working when the first updates of Windows 11 appear. In that case one would be stuck with a possibly buggy initial version.
  12. A.M. Hoornweg

    Developing under Windows 11 in a VM not feasible ?

    Some things (like Per-Monitor DPI-awareness V2) are really awkward to test through Remote Debugging. Delphi 11 still has tons of issues regarding DPI Awareness, for which I had to devise workarounds until Embarcadero hopefully gets it right. I expect some improvements to this feature in Windows 11 and it would be really nice to be able to debug it natively rather than remotely.
  13. A.M. Hoornweg

    Developing under Windows 11 in a VM not feasible ?

    I have no desire to switch to a different virtualization product. My appreciation of VMWare far exceeds any desire for Windows 11.
  14. A.M. Hoornweg

    Developing under Windows 11 in a VM not feasible ?

    That's not an option. VMWare workstation is essential to me, also because of compatibility with ESXI. (I don't know if other virtualizers that use "passthrough" TPM's don't have the same problem, because in that case the TPM also dies if the host breaks)
  15. A.M. Hoornweg

    Developing under Windows 11 in a VM not feasible ?

    Will that work on a new hardware? I mean, will VMWare Workstation boot a recent backup, if I exchange my notebook for a new one?
  16. A.M. Hoornweg

    Developing under Windows 11 in a VM not feasible ?

    A virtual HDD encrypted by VMWare would not be recoverable anymore indeed. [edit] I make weekly backups of my VM's on an external HDD. If they were cryptographically tied to my notebook's hardware, they would become worthless if my notebook broke.
  17. 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 ?
  18. 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.
  19. 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!
  20. 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?
  21. 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.
  22. 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.
  23. 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}.
  24. 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.
  25. If Microsoft used Delphi, Windows would be a petabyte in size.
×