System.TObject.ClassParent
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