LoadTreeFromStream- eternal loop- TeeTreeFindGlobalComponent
Posted: Fri Feb 23, 2007 11:49 am
Support,
I see this has come up before, but I did not see a solution.
I am using SaveTreeToStream & LoadTreeFromStream to copy the contents of one TTree to another, but I am getting an eternal loop in the 'TeeTreeFindGlobalComponent' procedure when calling LoadTreeFromStream.
Here is the sample code:
Form1 contains the source TTree and Form2 contains the destination TTree.
Kind regards,
Keith Blows
I see this has come up before, but I did not see a solution.
I am using SaveTreeToStream & LoadTreeFromStream to copy the contents of one TTree to another, but I am getting an eternal loop in the 'TeeTreeFindGlobalComponent' procedure when calling LoadTreeFromStream.
Here is the sample code:
Code: Select all
procedure TForm1.cmdStreamClick(Sender: TObject);
var
msTemp: TStream;
begin
Form2.Show;
Form1.TreeSource.NoOwnerShapes := False;
Form2.TreeDest.NoOwnerShapes := False;
msTemp := TMemoryStream.Create;
try
SaveTreeToStream(TCustomTree(Form1.TreeSource), msTemp);
msTemp.Position := 0;
LoadTreeFromStream(TCustomTree(Form2.TreeDest), msTemp);
finally
FreeAndNil(msTemp);
end;
end;
Form1 contains the source TTree and Form2 contains the destination TTree.
Kind regards,
Keith Blows