-
Content Count
3710 -
Joined
-
Last visited
-
Days Won
185
Everything posted by David Heffernan
-
Guidance on FreeAndNil for Delphi noob
David Heffernan replied to Paul Dardeau's topic in RTL and Delphi Object Pascal
Who settles for reducing risk when you can eliminate it? -
@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.
-
VCL UI Design Challenge for Delphi Developers 💡
David Heffernan replied to bravesofts's topic in VCL
I'm thinking of publishing my solution under a GPL copyleft style license. Will that be acceptable? -
Looking but not finding...
David Heffernan replied to Rick_Delphi's topic in Job Opportunities / Coder for Hire
Why do you limit yourself to Delphi then? -
EXE(.exe) still appears in process list, though the service destroyed.
David Heffernan replied to sp0987's topic in General Help
Do you have a question? -
Menu captions with images are hard to read under Windows 11
David Heffernan replied to Tom Mueller's topic in VCL
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??!! -
What new features would you like to see in Delphi 13?
David Heffernan replied to PeterPanettone's topic in Delphi IDE and APIs
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. -
(FYI) Delphi can't optimize out unneeded inheritance
David Heffernan replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
The reason this is not optimised away is that it would take development effort to do so but would bring no benefit to anyone. -
How do I close a modal form without ModalResult being set to mrCancel ?
David Heffernan replied to dormky's topic in VCL
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. -
How do I close a modal form without ModalResult being set to mrCancel ?
David Heffernan replied to dormky's topic in VCL
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. -
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.
-
How do I close a modal form without ModalResult being set to mrCancel ?
David Heffernan replied to dormky's topic in VCL
This makes no sense. It's logically identical. -
How do I close a modal form without ModalResult being set to mrCancel ?
David Heffernan replied to dormky's topic in VCL
Well, you don't know how Windows is implemented internally. Not that it matters. Conceptually it's the same mechanism. -
How do I close a modal form without ModalResult being set to mrCancel ?
David Heffernan replied to dormky's topic in VCL
EndDialog does it exactly the same way as Delphi does it, we already established that. -
How do I close a modal form without ModalResult being set to mrCancel ?
David Heffernan replied to dormky's topic in VCL
No, that call to Close should never be made. No ifs and buts. Stop guessing at how the system works. Really, how ? -
How do I close a modal form without ModalResult being set to mrCancel ?
David Heffernan replied to dormky's topic in VCL
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. -
How do I close a modal form without ModalResult being set to mrCancel ?
David Heffernan replied to dormky's topic in VCL
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. -
How do I close a modal form without ModalResult being set to mrCancel ?
David Heffernan replied to dormky's topic in VCL
Actually the Delphi approach is just the same. You just don't understand how EndDialog works. -
How do I close a modal form without ModalResult being set to mrCancel ?
David Heffernan replied to dormky's topic in VCL
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. -
How do I close a modal form without ModalResult being set to mrCancel ?
David Heffernan replied to dormky's topic in VCL
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. -
TListView - manually adding items faster at runtime
David Heffernan replied to JohnLM's topic in VCL
yeah, global variables in your GUI, great idea!- 17 replies
-
- delphi xe7
- listview
-
(and 1 more)
Tagged with:
-
TListView - manually adding items faster at runtime
David Heffernan replied to JohnLM's topic in VCL
As stated in the OP this is already being used. Virtual mode is the only answer.- 17 replies
-
- delphi xe7
- listview
-
(and 1 more)
Tagged with:
-
I mean, the memory can get paged out again so it's not that terrible. Another issue is that the paging system can't share the memory between processes if it's in memory rather than loaded off disk. I still don't understand what actual problem people who want to make their executables a few mb smaller are trying to solve.
-
Even if you don't use a debugger, get your program to print out the intermediate values in the function square. Then compare it to your expectation.
-
record functions with parameters?
David Heffernan replied to Nigel Thomas's topic in Algorithms, Data Structures and Class Design
Read the section on index specifiers https://docwiki.embarcadero.com/RADStudio/Sydney/en/Properties_(Delphi)