I have a D2006 app in which the DPR file has had numerous edits (yes, I know - you shouldn't mess with the DPR file) to accommodate such things as a splash screen, preventing a second instance of the app being started, handling of command line options that need to be processed before any forms are created, etc.
One day, I noticed that the auto-create forms list in the project options is empty - but the DPR file still has the code in there to create some of the forms.
If I try to restore all the forms that should be auto-created from the dialog, it complains Error - Call to Application->CreateForm is missing or incorrect
and doesn't do anything.
- How can I restore this connection - apart from rebuilding the DPR from scratch?
- is it safe to manually add the
CreateForm
calls? - are there any documented rules as to what you can do in the DPR file?
- I have a suspicion that try..except and if..else clauses in the DPR upset Delphi. Will moving as many functions as possible to a separate unit and calling them be helpful?
Main()
? I'm beginning to wonder if the best way isn't to do as you suggest - put everything in a separateMain
unit, remove all forms from the auto-create list dialog (and hope Delphi respects my wishes), and explicitly create what I want to be created at startup inside theMain
unit. – rossmcm