Can I use a DataModule form in a Console Delphi application?
I tried including an existing unit/form to a console Delphi application in the uses clause, but DataModule1 is resolved to nil (not initialized).
Just figured that by looking at a Form application that I simply need to do the initialization by hand:
Application.CreateForm(TDataModule1, DataModule1);
UPDATE
As suggested in the comments, I ended up implementing:
DataModule1 := TDataModule1.Create(nil)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With