CComBSTR::CopyTo

Alloca e restituisce una copia m_str tramite il parametro.

HRESULT CopyTo(
   BSTR* pbstr 
) throw( );
HRESULT CopyTo(
   VARIANT* pvarDest 
) throw( );

Parametri

  • pbstr
    [out] indirizzo BSTR in cui restituire la stringa allocata da questo metodo.

  • pvarDest
    [out] indirizzo VARIANT in cui restituire la stringa allocata da questo metodo.

Valore restituito

Un valore standard HRESULT che indica l'esito positivo o negativo di copia.

Note

Dopo avere chiamato questo metodo, VARIANT puntato da pvarDest sarà di tipo VT_BSTR.

Esempio

CComBSTR m_bstrURL; // BSTR representing a URL

// get_URL is the get method for the URL property. 
STDMETHOD(get_URL)(BSTR* pstrURL)
{
   // Make a copy of m_bstrURL and return it via pstrURL
   return m_bstrURL.CopyTo(pstrURL);
}

Requisiti

Header: atlbase.h

Vedere anche

Riferimenti

CComBSTR (classe)

CComBSTR::Copy

CComBSTR::operator =