RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TWriter.WriteComponent Method

Writes the component specified by Component to a stream.

Pascal
procedure WriteComponent(Component: TComponent);
C++
__fastcall WriteComponent(TComponent * Component);

Never call WriteComponent directly. WriteComponent is recursively called for each owned component in Root

WriteComponent sets the csWriting state in Component's ComponentState property before calling the WriteState method of Component and clears the csWriting flag when WriteState returns.

Note: The sequence of events is as follows: the writer's WriteComponent method calls the Component's WriteState method, which calls the writer's WriteData method. That method writes the properties for each child component, then calls WriteComponent.
Because the Component's WriteState is virtual, it is the Component's only opportunity to prepare itself to be streamed (i.e. to consolidate its data.) 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!