Hi All,
 I am trying to use a splash screen before my main application starts. I use 
the following. Does anyone see anything wrong with the below since it does not 
seem to bring up the Splash Screen. Thanks

Lefti
------------------------------------------unit 
Splash------------------------------------------------------------------------------
unit Splash;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
  StdCtrls;

type

  { TSplashForm }

  TSplashForm = class(TForm)
    Image1: TImage;
    Label1: TLabel;
    Label2: TLabel;
    procedure FormCreate(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end; 

var
  SplashForm: TSplashForm;

implementation

{ TSplashForm }

procedure TSplashForm.FormCreate(Sender: TObject);
begin
  sleep(20000);
end;

initialization
  {$I splash.lrs}

end.       

------------------------------------------unit 
Splash------------------------------------------------------------------------------

------------------------------------------Main 
project-----------------------------------------------------------------------------
program project1;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  Forms
  { you can add units after this }, SQLDBLaz, ProcessDesChild, Unit1, 
SharedVarsU, SharedLibsU, Splash;

begin
SplashForm:=TSplashForm.Create(Application);
SplashForm.Show;
SplashForm.Paint;
SplashForm.Update;
application.ProcessMessages;
application.Initialize;
//Delay(2000);
  Application.Initialize;
  Application.CreateForm(TMainForm, MainForm);
  SplashForm.Hide;
  SplashForm.Close;
  SplashForm.Release;
  SplashForm.Free;
  Application.Run;
end.

------------------------------------------Main 
project-----------------------------------------------------------------------------


_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to