System.Variants.VarSupports

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function VarSupports(const V: Variant; const IID: TGUID; out Intf): Boolean;
function VarSupports(const V: Variant; const IID: TGUID): Boolean;

C++

extern DELPHI_PACKAGE bool __fastcall VarSupports(const System::Variant &V, const GUID &IID, /* out */ void *Intf)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.Variants.pas
System.Variants.hpp
System.Variants System.Variants

Description

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

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++).

See Also