我这样试着是可以的:
Unit1~~Form1:主窗体
Unit2~~splash Splash窗体
project->Options:把Splash窗体设为非自动产生窗体
procedure TForm1.FormCreate(Sender: TObject);
var
CurTime:LongWord;
Delaytime:LongWord;
begin
delaytime:=5000;
curtime:=GetTickCount ;
while(gettickcount<(curtime+delaytime))do
Application.ProcessMessages; //建议加上该句。
end;
program Project1;
uses
Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {splash};
{$R *.res}
begin
Application.Initialize;
splash:=Tsplash.Create(application);
Splash.Show;
Splash.update;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
Delphi6+win2k 编译,运行,通过。
未定义的TForm1,然后提示Unit2单元不能编译,你可能未USE TFORM1,也可能你把TFORM1改名了,而在代码中又用了它.你双击这个ERROR,看看定位在那里,再联系上下看一下,像这样的提示不般不是大问题!
Unit2.pas 是哪个窗体的?