CComBSTR::AppendBytes

指定したバイト数のデータを変換せずに m_str に追加します。

HRESULT AppendBytes(
   const char* lpsz,
   int nLen
) throw( );

パラメーター

  • lpsz
    [入力] 追加するバイトの配列へのポインター。

  • p
    [入力] 追加するバイト数。

戻り値

正常に終了した場合は、S_OK を返します。それ以外の場合は、標準の HRESULT エラー値を返します。

使用例

CComBSTR bstrPre(OLESTR("Hello "));
HRESULT hr;

// Appends "Wo" to "Hello " (4 bytes == 2 characters)
hr = bstrPre.AppendBytes(reinterpret_cast<char*>(OLESTR("World!")), 4);

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

必要条件

ヘッダー: atlbase.h

参照

関連項目

CComBSTR クラス

CComBSTR::Append

CComBSTR::operator +=

CComBSTR::operator +=