Partilhar via


CComBSTR::AppendBSTR

Appends the specified BSTR to m_str.

HRESULT AppendBSTR(
   BSTR p 
) throw( );

Parameters

  • p
    [in] A BSTR to append.

Return Value

S_OK on success, or any standard HRESULT error value.

Remarks

Do not pass an ordinary wide-character string to this method. The compiler cannot catch the error and run time errors will occur.

Example

CComBSTR bstrPre(OLESTR("Hello "));
CComBSTR bstrSuf(OLESTR("World!"));
HRESULT hr;

// Appends "World!" to "Hello "
hr = bstrPre.AppendBSTR(bstrSuf);

// Displays a message box with text "Hello World!"
::MessageBox(NULL, CW2CT(bstrPre), NULL, MB_OK);   

Requirements

Header: atlbase.h

See Also

Reference

CComBSTR Class

CComBSTR::Append

CComBSTR::operator +=

Concepts

ATL and MFC String Conversion Macros

Other Resources

CComBSTR Members