Table of Contents

TObjectFactory.CreateInstance Method

Creates a new instance of the specified class by invoking its parameterless constructor via RTTI.

Syntax

Unit: Bcl.Rtti.ObjectFactory

function TObjectFactory.CreateInstance(AClass: TClass): TObject;

Parameters

<-> Parameter Type Description
AClass TClass The class reference to instantiate.

Returns

A new instance of AClass, or nil if no parameterless constructor is found.

See also