Jump to content

David Heffernan

Members
  • Content Count

    3659
  • Joined

  • Last visited

  • Days Won

    181

Everything posted by David Heffernan

  1. David Heffernan

    Guidance on FreeAndNil for Delphi noob

    This one is easy to debunk. Exceptions raised in a constructor then lead to exceptions in the destructor. This is the entire reason why Free exists.
  2. David Heffernan

    Guidance on FreeAndNil for Delphi noob

    I get all the arguments that using FAN in a destructor is pointless, because how can you using that reference beyond the destructor. And I understand the argument for using it in a reference for an object that exists optionally, and can be destroyed outside of the destructor. What I don't get is what the downsides of using FAN are. What are the drawbacks?
  3. David Heffernan

    Guidance on FreeAndNil for Delphi noob

    Simple. Understand the problem, and write your code so that it works 100% of the time. It's one thing that you aren't able to do so. That's your problem. But to come on a site like this and recommend that others work like this is wild. How about you retract this terrible advice?
  4. David Heffernan

    Guidance on FreeAndNil for Delphi noob

    Who settles for reducing risk when you can eliminate it?
  5. David Heffernan

    Get Form Name

    @Henry Olive A Delphi programmer will be able to come up with the code give the information above. There is documentation and VCL source. If you don't have a Delphi programmer on your team you have bigger problems.
  6. David Heffernan

    Looking but not finding...

    Why do you limit yourself to Delphi then?
  7. David Heffernan

    Menu captions with images are hard to read under Windows 11

    I still modify the VCL to let the system draw the menus and provide PARGB32 bitmaps because the VCL code still doesn't get them right. When was Vista released??!!
  8. David Heffernan

    What new features would you like to see in Delphi 13?

    I guess problems still arise when forms move back and forth at runtime. Because then you can't avoid down scale and then up scale.
  9. The reason this is not optimised away is that it would take development effort to do so but would bring no benefit to anyone.
  10. I suggest you try to design a GUI framework that can everything that the VCL can. Well, not for modal forms. Which makes David's post hard to fathom. It is called when closing modeless forms. Modal and modeless are very different. Again something that you see in the Windows API. It's more like needing different keys to lock your house and your car. Different problems tend to lead to different solutions. The bottom line here is that modal forms run in a dedicated message loop, and modeless forms run in the message loop of their owner. I don't think you appreciate this yet. Writing a raw Win32 program in C in the Petzold style might help you.
  11. I seem to have lost track. In Delphi you write ModalResult := mrOk; In Windows you write EndDialog(hDlg, ID_OK); Explain why this is better. Because I cannot see it. Mostly I see you having not read the documentation and trying to blame the API design.
  12. David Heffernan

    Memory leak on parsing json

    No, FastMM is not causing leaks, you have not identified the problem yet. The first thing to do is stop looking at task manager. Use the leak reporting mechanism to identify leaks.
  13. This makes no sense. It's logically identical.
  14. Well, you don't know how Windows is implemented internally. Not that it matters. Conceptually it's the same mechanism.
  15. EndDialog does it exactly the same way as Delphi does it, we already established that.
  16. No, that call to Close should never be made. No ifs and buts. Stop guessing at how the system works. Really, how ?
  17. Windows API can't expose a flag directly so has to provide a function to set it. You are incapable of learning, no wonder this is so hard for you.
  18. Imagine if you would read documentation. Like that for EndDialog. And imagine if the documentation for EndDialog said this: EndDialog does not destroy the dialog box immediately. Instead, it sets a flag and allows the dialog box procedure to return control to the system. The system checks the flag before attempting to retrieve the next message from the application queue. If the flag is set, the system ends the message loop, destroys the dialog box, and uses the value in nResult as the return value from the function that created the dialog box. So yeah, it's exactly the same as the Delphi mechanism. Because that's how modal dialog are implemented in Windows.
  19. Actually the Delphi approach is just the same. You just don't understand how EndDialog works.
  20. Instead of ranting, perhaps you should take the opportunity to learn something and take advantage of it in the future. We all make mistakes. Failing to accept the is how people don't develop.
  21. Wow. This is so wrong. That call to Close is definitely getting executed. Setting ModalResult doesn't raise an exception. Which would be the only way to avoid Close getting called.
  22. David Heffernan

    TListView - manually adding items faster at runtime

    yeah, global variables in your GUI, great idea!
  23. David Heffernan

    TListView - manually adding items faster at runtime

    As stated in the OP this is already being used. Virtual mode is the only answer.
×