System.Rtti.TVirtualInterface.Create
Delphi
constructor Create(PIID: PTypeInfo); overload;
constructor Create(PIID: PTypeInfo; InvokeEvent: TVirtualInterfaceInvokeEvent); overload;
C++
__fastcall TVirtualInterface(System::Typinfo::PTypeInfo PIID)/* overload */;
__fastcall TVirtualInterface(System::Typinfo::PTypeInfo PIID, _di_TVirtualInterfaceInvokeEvent InvokeEvent)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
constructor | public | System.Rtti.pas System.Rtti.hpp |
System.Rtti | TVirtualInterface |
Description
Creates and initializes a TVirtualInterface instance.
TVirtualInterface creates an implementation of a specific interface at run time (the interface is specified by the PIID
parameter.)
The parameters of Create are listed in the following table:
Parameter | Description |
---|---|
PIID
|
Type information for the target interface. You can get it with the help of TypeInfo. |
InvokeEvent
|
The event that is raised when a specific interface method is called. You can specify it in the constructor (optionally), or using the OnInvoke property. |
You should create a TVirtualInterface instance and immediately get the corresponding interface instance. You should never create a TVirtualInterface as a local variable. A TVirtualInterface instance has an associated reference counter and automatically frees itself.