L
liujin
Unregistered / Unconfirmed
GUEST, unregistred user!
Procedure TCreateCom.ControlLoad(FileName :String);
var
Ts : TFileStream;
New : TComponent;
Read1 : TReader;
begin
Classes.RegisterClasses([TLabelX]);
TS := TFileStream.Create (FileName,fmOpenRead or fmShareDenyWrite);
While TS.Position < TS.Size Do
begin
Read1 := TReader.Create(TS,4096);
try
Read1.Parent := FOwner;
New := Read1.ReadRootComponent(nil);
if New is TLabelX then
(New as TLabelX).LabelMove;
FOwner.InsertComponent(New);
Finally
Read1.Free;
end;
end;
Ts.Free;
end;
运行到New := Read1.ReadRootComponent(nil);这里时
老是提示类没找到“Class TLabelX not found”
var
Ts : TFileStream;
New : TComponent;
Read1 : TReader;
begin
Classes.RegisterClasses([TLabelX]);
TS := TFileStream.Create (FileName,fmOpenRead or fmShareDenyWrite);
While TS.Position < TS.Size Do
begin
Read1 := TReader.Create(TS,4096);
try
Read1.Parent := FOwner;
New := Read1.ReadRootComponent(nil);
if New is TLabelX then
(New as TLabelX).LabelMove;
FOwner.InsertComponent(New);
Finally
Read1.Free;
end;
end;
Ts.Free;
end;
运行到New := Read1.ReadRootComponent(nil);这里时
老是提示类没找到“Class TLabelX not found”