Show: Object Pascal C++
Display Preferences

__classid

From Appmethod Topics
Jump to: navigation, search

Go Up to C++ Keyword Extensions


Category

Operators, Keyword Extensions

Syntax

__classid(classType)

Description

The __classid operator was added to support the VCL framework. You can use it to obtain the metaclass of a TObject-based class (a Object Pascal-style class).

For example, __classid is used when registering property editors, components, and classes, and with the InheritsFrom method of TObject. The following code illustrates the use of __classid for creating a new component derived from TWinControl:

namespace Ywndctrl
{
  void __fastcall PACKAGE Register() {
    TComponentClass classes[1] = {__classid(MyWndCtrl)};
    RegisterComponents("Additional", classes, 0);
  }
}

See Also

Personal tools
In other languages