__classid

From RAD Studio
Jump to: navigation, search

Go Up to C++ Keyword Extensions


Category

Operators (C++), 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 Delphi-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

Retrieved from "https://docwiki.embarcadero.com/RADStudio/Florence/e/index.php?title=Classid&oldid=255517"