Lazarus

Using the Lazarus IDE => Designer => Topic started by: cazzajay on July 07, 2009, 02:55:15 pm

Title: Lazarus and Splash Screens
Post by: cazzajay on July 07, 2009, 02:55:15 pm
Hi all,

I am trying to put a splash screen on my project in Lazarus using the normal delphi code but it gives me an error at compilation saying

  "Exception with message: failed to create win32 control, error: 1407"

Any ideas? I have posted the code I am using in the LPR here:

(I am using a non auto creating form called splashscreen with unit called "splash", which is in the uses section of the LPR.)

begin
Application.Title := 'MyProgram';
{$I MyProgram.lrs}
splashscreen.Tsplashscreen.Create(Application);
Application.initialize;
splashscreen.show;
splashscreen.update;
Application.createform(TForm1, Form1)
splashscreen.hide;
splashscreen.free;
application.run;
end;

Based on process of elimination it seems the problem is the manual creation of the splashscreen form?  I have tried putting it after application.initialize but same error appears.  %)
Title: Re: Lazarus and Splash Screens
Post by: theo on July 07, 2009, 03:45:19 pm
The Lazarus IDE has a splashscreen and you have all the sources.
So why not have a look at <lazarus>/ide/lazarus.pp ?
Title: Re: Lazarus and Splash Screens
Post by: Vincent Snijders on July 07, 2009, 04:00:57 pm
Anyway, Application.Initialize must be called before creating any form.
Title: Re: Lazarus and Splash Screens
Post by: cazzajay on July 07, 2009, 04:40:33 pm
Thanks, i've figured it out - i just needed to change formstyle to splash! d'oh ;)
TinyPortal © 2005-2018