Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi forms in dlls

Tags:

delphi

Is it good idea to put Forms that have complete functionality in dll. And main app will invoke dll function that returns form object.

like image 717
userbb Avatar asked Mar 17 '26 20:03

userbb


1 Answers

The accepted way to do this in Delphi is to use packages rather than DLLs.

Packages are essentially DLLs but with Delphi specific capabilities that allow VCL objects to be used across package boundaries.

Trying to do this with DLLs will lead to a variety of problems that packages deal with. One downside of packages is that all modules must be compiled with the same version of Delphi. But if you are wanting to share objects across module boundaries then you would face the same restriction if you used DLLs.

The Delphi documentation has extensive coverage of packages.

Having said all that, I would add that if you can put all your code into a single module (.exe or .dll) then it does make life a lot simpler.

like image 65
David Heffernan Avatar answered Mar 19 '26 11:03

David Heffernan