No... :-)
If you always create the mainform first, then the problme woudl
disappear.
I dont have any datasets on teh main form, so it does not rely on
the datamodule.
And, its best to put misc code in a separate file and call a
procedure... because the IDE fiddles a lot in there. For instance,
accessing application.title, makes it very confused and you cant
even save the project file then. Basically this is the IDE's territory,
you cant fight it.
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Send reply to: [EMAIL PROTECTED]
From: "Neven MacEwan" <[EMAIL PROTECTED]>
Subject: [DUG]: Any way to stop IDE maintaining Project File
Date sent: Tue, 5 Sep 2000 12:13:17 +1200
Organization: MWK Computer Systems
> 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"
>
Rohit
======================================================================
CFL - Computer Fanatics Ltd. 21 Barry's Point Road, AKL, New Zealand
PH (649) 489-2280
FX (649) 489-2290
email [EMAIL PROTECTED] or [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"