RAD Studio VCL Reference
|
Implements the IInterface QueryInterface method.
function QueryInterface(const IID: TGUID; out Obj): HResult; override; stdcall;
QueryInterface is called through the IInterface interface to obtain an interface pointer for the interface identified by the IID parameter. In Delphi, this call is generated when an application casts TLinkedRIO to an invokable interface using the as operator.
TLinkedRIO can only return a single type of interface pointer. The first time an application calls QueryInterface, TLinkedRIO generates an in-memory method table to support calls to the methods on the requested interface.
IID specifies the invokable interface that the application wants to call using this TLinkedRIO instance. If the TLinkedRIO object has already been typecast to an interface, then IID must identify that interface. If the TLinkedRIO instance has not yet been typecast to an interface, then IID must be a registered invokable interface.
Obj returns an interface pointer for the specified interface, unless TLinkedRIO was already implementing a different interface or IID identified an interface that was not registered.
QueryInterface returns 0 (S_OK) if Obj successfully returns an interface pointer. It returns E_NOINTERFACE otherwise.
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|