CComVariant::SetByRef

Initializes the CComVariant object and sets the vt member to VT_BYREF.

template< typename T > 
void SetByRef( 
   T* pT  
) throw();

Parameters

  • T
    The type of VARIANT, for example, BSTR, int, or char.

  • pT
    The pointer used to initialize the CComVariant object.

Remarks

SetByRef is a function template that initializes the CComVariant object to the pointer pT and sets the vt member to VT_BYREF. For example:

CComVariant var;
int nData = 10;
var.SetByRef(&nData);   

Requirements

Header: atlcomcli.h

See Also

Reference

CComVariant Class