Table of Contents

ITMSFNCPersistenceIO.CreateObject Method

Creates and returns a new instance of the class identified by AClassName, constrained to be a descendant of ABaseClass.

API unit family: TMSFNCPersistence Declaring type: ITMSFNCPersistenceIO Inherited from: ITMSFNCBasePersistenceIO

Syntax

function CreateObject(const AClassName: string; const ABaseClass: TClass): TObject;

Parameters

Name Description
AClassName Fully-qualified class name to instantiate.
ABaseClass Required base class; the factory must refuse to create objects that are not descendants of this class.

Returns

The newly created object, or nil if the class name could not be resolved or does not descend from ABaseClass.