runtime class information

Top  Previous  Next

User interface > Translation options > Other compiler > runtime class information

 

In the Microsoft Foundation Classes (MFC) the macros DECLARE_DYNAMIC and IMPLEMENT_DYNAMIC give access to runtime class information, similar to the  runtime information that is provided in the VCL by the accordingly overwritten functions of TObject or by TD2CObject. If you need runtime information and don't like to use TD2CObject, you can activate the insertion of these macros in the options dialog at the page Other compiler.

 

 

DeclareDynamic

 

 

The macros can be renamed by means of the substitution table of the translator. An obvious alternative would be to use the macros "DECLARE_DYNCREATE" and "IMPLEMENT_DYNCREATE" also defined for the MFC in the file "afx.h".

 

 

The following table compares the class names and functions of the MFC and Delphi:

 

 

class CObject

class TObject

struct CRuntimeClass

class TMetaClass

CObject::GetRuntimeClass

TObject::ClassType

CRuntimeClass::IsDerivedFrom

TMetaClass::InheritsFrom

CObject::IsKindOf

TObject::InheritsFrom

CRuntimeClass::CreateObject

     TMetaClass::Create

CObject::CreateObject

TObject::Create

 

 



This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content