System.Classes.TStream.ReadComponentRes

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function ReadComponentRes(const Instance: TComponent): TComponent;

C++

TComponent* __fastcall ReadComponentRes(TComponent* const Instance);

Properties

Type Visibility Source Unit Parent
function public
System.Classes.pas
System.Classes.hpp
System.Classes TStream

Description

Reads components and their properties from a stream in a resource file format.

ReadComponentRes is called automatically by the global routine ReadComponentResFile. It can also be called directly if the current position of the stream points to a component written using the WriteComponentRes method.

ReadComponentResFile creates a file stream object, which then calls its ReadComponentRes method.

ReadComponentRes first calls the ReadResHeader method to read a resource header from the stream. If the stream does not contain a resource header at the current position, ReadResHeader will raise an EInvalidImage exception. ReadComponentRes then calls ReadComponent to read the properties that must be set on Instance.

See Also