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::Attach.

Microsoft Specific**

Attaches a VARIANT object into the _variant_t object.

      void Attach(  
   VARIANT& varSrc   


A VARIANT object to be attached to this _variant_t object.

Takes ownership of the VARIANT by encapsulating it. This member function releases any existing encapsulated VARIANT, then copies the supplied VARIANT, and sets its VARTYPE to VT_EMPTY to make sure its resources can only be released by the _variant_t destructor.

END Microsoft Specific

_variant_t Class