What version of Delphi are you using?
I am using Delphi 5 and I don't have a problem with this. My application
creates several datamodules and then creates the main form using a form
controller object (which calls Application.CreateForm internally). For
example...
Application.Initialize;
Application.Title := 'Shower System';
Application.CreateForm(TdmAdoController, dmAdoController);
... etc
// Following line creates application main form.
fWorkInProgress :=
TfWorkInProgress(GFormController.DisplayMainForm(GFormController.MainFormNam
e, Null));
Application.Run;
...works fine - Delphi doesn't try putting in a call to
Application.CreateForm. Have you tried removing your mainform from the
Project\Options\Forms tab since you are in effect creating the form manully?
David.
DB Solutions.
----- Original Message -----
From: "Neven MacEwan" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Tuesday, September 05, 2000 12:13 PM
Subject: [DUG]: Any way to stop IDE maintaining Project File
> I Have the following project file
> But the IDE keeps on spontaneously putting in an extra
> Application.CreateForm(TMainForm, MainForm);
>
> Any way to prevent this (bar flagging the file RO)
>
> Regards
> Neven
>
>
> begin
> {Attempt to create a named mutex}
> CreateMutex(nil, false, 'MWK-Athena');
> {if it failed then there is another instance}
> if GetLastError = ERROR_ALREADY_EXISTS then begin
> {Send all windows our custom message - only our other}
> {instance will recognise it, and restore itself}
> SendMessage(HWND_BROADCAST, RegisterWindowMessage('MWK-Athena'), 0,
0);
> Halt(0);
> end;
> Application.Initialize;
> with TSplashForm.Create(nil) do
> try
> if FindWindow('TAppBuilder',nil) = 0 then // ide not running
> begin
> Show; // show a splash screen
> Update; // force display
> end;
> Application.Title := 'MWK Athena';
> Application.CreateForm(TADataModule, ADataModule);
> if ADataModule.Active then
> begin
> Application.CreateForm(TMainForm, MainForm);
> Application.CreateForm(TDBUpdateErrorDlg, DBUpdateErrorDlg);
> end;
> finally
> Free;
> end;
> Application.Run;
> end.
>
>
> Regards Neven
> N.K. MacEwan B.E. E&E
> Ph 649 574 0027
> Fax 649 570 2706
> Mobile 025 749 062
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
> --------------------------------------------------------------------------
-
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"