CComBSTR::AppendBSTR

追加指定的 BSTRm_str

HRESULT AppendBSTR( 
   BSTR p  
) throw( );

参数

  • p
    [in]一个附加 BSTR

返回值

在成功的S_OK,或者任何标准 HRESULT false值。

备注

不要将一个普通的宽字符字符串传递给此方法。 编译器无法捕获错误,而运行时将发生错误。

示例

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

要求

Header: atlbase.h

请参见

参考

CComBSTR 类

CComBSTR::Append

CComBSTR::operator +=

概念

ATL and MFC String Conversion Macros