[lazarus] Splash screen woes
Tony Maro
tonym at nlisc.com
Mon Oct 7 11:40:08 EDT 2002
This is odd.
I'm working on a splash screen for my app (since loading 3 years of
transactions may take a few seconds) and ran into the following:
Here's from my LPR:
var
MyParam: String;
begin
if paramcount > 0 then begin
MyParam := Paramstr(1);
end;
if ((MyParam = '-h') or (MyParam = '-v')) then begin
writeln('CheckBook Tracker');
writeln('Written by Anthony Maro');
writeln('-----------------------');
writeln('Version 0.9.2');
end else begin
Application.Initialize;
FrmSplash := TFrmSplash.Create(Application);
FrmSplash.Show;
FrmSplash.Refresh;
Application.Processmessages;
Application.CreateForm(TFrmMain, FrmMain);
Application.CreateForm(TFrmAbout, FrmAbout);
Application.CreateForm(TFrmSettings, FrmSettings);
Application.CreateForm(TFrmBalance, FrmBalance);
Application.CreateForm(TFrmStarting, FrmStarting);
Application.CreateForm(TFrmNewSchedDep, FrmNewSchedDep);
Application.CreateForm(TFrmWorking, FrmWorking);
Application.CreateForm(TFrmEnterDep, FrmEnterDep);
Application.CreateForm(TFrmEnterWithdrawal, FrmEnterWithdrawal);
// Application.CreateForm(TFrmSplash, FrmSplash);
Application.Run;
end;
end.
You can see I'm forcing the FrmSplash to display prior to loading the
other forms. I then close and free it at the end of the FrmMain.OnShow
event
This works just great UNLESS the FrmMain position is set to
poDesktopCenter. There may be other position settings that might crash
too, but poDesigned and poDefault work fine.
net result is that as soon as FrmMain is shown, the application crashes
in TCONTROL__SETVISIBLE line 1624 with access violation.
More information about the Lazarus
mailing list