> I tried the code but, where should I free/close the frmSplash form? I
> use this to show the user a "Loading data..." message while the app delays
> opening tables in it's OnCreate event handler.
My Ideal placement is in the DPR file surrounding all initialization code so
that any forms (not just the main form) created do all their processing
during display of the splash form. The splash form is destroyed immediately
following the applications readiness to become interactive.
program BLAH;
uses
Forms,
{...}
Main in 'Main.pas' {FrmMain},
Splash in 'Splash.pas' {FrmSplash};
{$R *.RES}
var
FS :TFrmSplash;
{Not using a global Object instance pointer. The only globals are The mainform
(probably not necessary) and any shared Datamodules. All other Forms are created
on demand and references passed by parameter where necessary.}
begin
FS := TFrmSplash.Create(nil);
try
FS.Show;
{Do lots of setup stuff}
{like creating the connection to the ORACLE database from registry settings}
{Copying a constraints model from the database to the client}
Application.Initialize;
Application.CreateForm(TFrmMain, FrmMain);
Application.Run;
finally
// It is not clear in the help whether this is necessary but it calls Free anyway.
FS.Release;
end;
end.
--
Aaron Scott-Boddendijk
Jump Productions
(07) 838-3371 Voice
(07) 838-3372 Fax
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz