System.Classes.GetClass

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetClass(const AClassName: string): TPersistentClass;

C++

extern DELPHI_PACKAGE TPersistentClass __fastcall GetClass(const System::UnicodeString AClassName);

Properties

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

Description

Returns a registered persistent class given its name.

Call GetClass to obtain a class from a class name. This class can be used as a parameter to routines that require a class.

The Class must be registered before GetClass can find it. Form classes and component classes that are referenced in a form declaration (instance variables) are automatically registered when the form is loaded. Other classes can be registered by calling RegisterClass or RegisterClasses.

Note: To obtain an unregistered class from a class name in C++, use the __classid routine.

See Also

Code Examples