3
38152977
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TApplication.CreateForm(InstanceClass: TComponentClass; var Reference);
var
Instance: TComponent;
begin
Instance := TComponent(InstanceClass.NewInstance);
TComponent(Reference) := Instance;//这句完成后,按理还没有执行框架,Reference是不能执行的。
try
Instance.Create(Self); //这是执行架框,这句按理应该放在前一句前面。我不理解。为什么??????
except
TComponent(Reference) := nil;
raise;
end;
if (FMainForm = nil) and (Instance is TForm) then
begin
TForm(Instance).HandleNeeded;
FMainForm := TForm(Instance);
end;
end;
var
Instance: TComponent;
begin
Instance := TComponent(InstanceClass.NewInstance);
TComponent(Reference) := Instance;//这句完成后,按理还没有执行框架,Reference是不能执行的。
try
Instance.Create(Self); //这是执行架框,这句按理应该放在前一句前面。我不理解。为什么??????
except
TComponent(Reference) := nil;
raise;
end;
if (FMainForm = nil) and (Instance is TForm) then
begin
TForm(Instance).HandleNeeded;
FMainForm := TForm(Instance);
end;
end;