_variant_t Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at _variant_t Class.

Microsoft Specific**

A _variant_t object encapsulates the VARIANT data type. The class manages resource allocation and deallocation and makes function calls to VariantInit and VariantClear as appropriate.

Construction

_variant_tConstructs a _variant_t object.

Operations

AttachAttaches a VARIANT object into the _variant_t object.
ClearClears the encapsulated VARIANT object.
ChangeTypeChanges the type of the _variant_t object to the indicated VARTYPE.
DetachDetaches the encapsulated VARIANT object from this _variant_t object.
SetStringAssigns a string to this _variant_t object.

Operators

Operator =Assigns a new value to an existing _variant_t object.
operator ==, !=Compare two _variant_t objects for equality or inequality.
ExtractorsExtract data from the encapsulated VARIANT object.

Header: comutil.h

Lib: comsuppw.lib or comsuppwd.lib (see /Zc:wchar_t (wchar_t Is Native Type) for more information)

Compiler COM Support Classes

Show: