System.TObject.ClassParent

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

class function ClassParent: TClass;

C++

__classmethod TClass __fastcall ClassParent();

Properties

Type Visibility Source Unit Parent
function public
System.pas
systobj.h
System TObject

Description

Returns the type of the immediate ancestor of a class.

ClassParent returns the name of the parent class for an object instance or class reference. For TObject, ClassParent returns nil (Delphi) or NULL (C++).

Avoid using ClassParent in application code.

Note: In Delphi code, use the is or as operators instead of ClassParent.

Note: In C++ code, use a dynamic cast or the InheritsFrom method instead of ClassParent.

See Also

Code Examples


Retrieved from "https://docwiki.embarcadero.com/Libraries/Tokyo/e/index.php?title=System.TObject.ClassParent&oldid=625151"