Hi.

I didn't used streams to much until now.
I am trying to save a control to disk using TFileStream.WriteComponent.
Everything is ok if that control is alone, but if it is the owner of 
other controls (run time created), my code fails to load it back from 
disk with the error 'Class xxx not found', where xxx is the child control.

Looking in Google I have found other people with the same problem but no 
solution that really works.
Some of them are saying that overriding the GetChildren with something 
like this:

Procedure TComponent.GetChildren(Proc: TGetChildProc; Root: TComponent);
var i: longint;
begin
  If Not assigned(FComponents) then exit;
  For i:=0 to FComponents.Count-1 do
    Proc(TComponent(FComponents[I]));
end;

will fix the problem but it doesn't.

At this moment I can save/load that control using a record. I just 
read/write that record to a typed file and everything is nice and peaceful.
I just wanted to try 'streaming' because some people are speaking about 
streaming like it is the solution for everything.
Anyway it looks like it has serious limitations :)

Can somebody point me to a document/example which shows how to 
stream/save a parent control (maybe even a TForm)?

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to