Поделиться через


CComBSTR::CopyTo

Allocates and returns a copy of m_str via the parameter.

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

Параметры

  • pbstr
    [out] The address of a BSTR in which to return the string allocated by this method.

  • pvarDest
    [out] The address of a VARIANT in which to return the string allocated by this method.

Возвращаемое значение

A standard HRESULT value indicating the success or failure of the copy.

Заметки

After calling this method, the VARIANT pointed to by pvarDest will be of type VT_BSTR.

Пример

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);
}

Требования

Header: atlcomcli.h

См. также

Основные понятия

CComBSTR Class

CComBSTR Members

CComBSTR::Copy

CComBSTR::operator =