RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
Variants.VarSupports Function

Indicates whether the 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);

Variants

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 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 Variant's value is nil (Delphi) or NULL (C++). 

 

Supports

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!