CComVariant( );
CComVariant( const CComVariant& varSrc );
CComVariant( const VARIANT& varSrc );
CComVariant( LPCOLESTR lpsz );
CComVariant( LPCSTR lpsz );
CComVariant( BSTR bstrSrc );
CComVariant( bool bSrc );
CComVariant( int nSrc );
CComVariant( BYTE nSrc );
CComVariant( short nSrc );
CComVariant( long nSrc, VARTYPE vtSrc = VT_I4 );
CComVariant( float fltSrc );
CComVariant( double dblSrc );
CComVariant( CY cySrc );
CComVariant( IDispatch* pSrc );
CComVariant( IUnknown* pSrc );
Parameters
varSrc
[in] The CComVariant or VARIANT used to initialize the CComVariant object.
lpsz
[in] The character string used to initialize the CComVariant object. The Unicode version specifies an LPCOLESTR; the ANSI version specifies an LPCSTR.
bstrSrc
[in] The BSTR used to initialize the CComVariant object.
bSrc
[in] The bool used to initialize the CComVariant object.
nSrc
[in] The int, BYTE, short, or long used to initialize the CComVariant object.
vtSrc
[in] The type for the CComVariant object. This parameter is available only when passing a long for nSrc. vtSrc can only be VT_I4 (the default value) or VT_ERROR; otherwise, the constructor will assert.
fltSrc
[in] The float used to initialize the CComVariant object.
dblSrc
[in] The double used to initialize the CComVariant object.
cySrc
[in] The CY used to initialize the CComVariant object.
pSrc
[in] The IDispatch or IUnknown pointer used to initialize the CComVariant object.
Remarks
Each constructor initializes the object by calling the VariantInit Win32 function. If you pass a parameter value, the constructor sets the object's value and type accordingly.
The destructor manages cleanup by calling CComVariant::Clear.