Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CComBSTR::AppendBSTR

 

Appends the specified BSTR to m_str.


      HRESULT AppendBSTR(
   BSTR p 
) throw( );

p

[in] A BSTR to append.

S_OK on success, or any standard HRESULT error value.

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

Show: