* * *

Author Topic: Lazarus and Splash Screens  (Read 12138 times)

cazzajay

  • Jr. Member
  • **
  • Posts: 94
Lazarus and Splash Screens
« 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.  %)
Windows XP 32 bit / Lazarus 1.0.6 / FPC 2.6.0

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1890
Re: Lazarus and Splash Screens
« Reply #1 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 ?

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2660
    • My Lazarus wiki user page
Re: Lazarus and Splash Screens
« Reply #2 on: July 07, 2009, 04:00:57 pm »
Anyway, Application.Initialize must be called before creating any form.

cazzajay

  • Jr. Member
  • **
  • Posts: 94
Re: Lazarus and Splash Screens
« Reply #3 on: July 07, 2009, 04:40:33 pm »
Thanks, i've figured it out - i just needed to change formstyle to splash! d'oh ;)
Windows XP 32 bit / Lazarus 1.0.6 / FPC 2.6.0

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus