RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
Variants.VarSupports Function

Indicates whether the System::Variant's value is an interface that supports a specified interface.

Pascal
function VarSupports(const V: Variant; const IID: TGUID; out Intf): Boolean; overload;
function VarSupports(const V: Variant; const IID: TGUID): Boolean; overload;
C++
Boolean VarSupports(const Variant V, const TGUID IID,  Intf);
Boolean VarSupports(const Variant V, const TGUID IID);

VarSupports returns the lower twelve bits of a variant type code. These indicate the type of the variant. For a list of possible variant type codes, see VarType

Call VarSupports to determine whether the System::Variant represents an interface that supports the interface identified by the IID parameter. If V supports the interface, VarSupports returns the interface as the Intf parameter (if using the first syntax) and returns true (both versions). If the interface specified by IID is not supported, VarSupports returns false. 

Unlike calling the QueryInterface method of the interface, VarSupports handles the case when the System::Variant's value is nil (Delphi) or NULL (C++). 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!