共用方式為


CToolBarCtrl::AddStrings

將新的字串或字串至字串清單中可用的工具列控制項。

int AddStrings(
   LPCTSTR lpszStrings 
);

參數

  • lpszStrings
    包含一個或多個 null 結尾字串加入至工具列的字串清單緩衝區的位址。 必須結束的最後一個字串含有兩個 null 字元。

傳回值

第一個加入的新字串之以零起始的索引,如果成功,則為– 1。

備註

必須以 null 字元來分隔緩衝區的資料。 您必須確定最後一個字串還有兩個 null 結束字元。 正確格式常數字串,您可以撰寫會如下所示:

// one null added automatically
lpszStrings = _T("Only one string to add\0");   

或:

// adds three strings with one call
lpszStrings = _T("String 1\0String 2\0String 3\0");   

因為已經超過 CString, null 字元無法反映您不應該傳遞至該函式的 CString 物件。

需求

Header: afxcmn.h

請參閱

參考

CToolBarCtrl 類別

階層架構圖

CToolBarCtrl::AddString

CToolBarCtrl::AddButtons

CToolBarCtrl::InsertButton

CToolBarCtrl::AddBitmap