Export (0) Print
Expand All
Expand Minimize

CToolBarCtrl::AddStrings

Adds a new string or strings to the list of strings available for a toolbar control.

int AddStrings( 
   LPCTSTR lpszStrings  
);

lpszStrings

Address of a buffer that contains one or more null-terminated strings to add to the toolbar's string list. The last string must be terminated with two null characters.

The zero-based index of the first new string added if successful; otherwise –1.

Strings in the buffer must be separated by a null character. You must ensure that the last string has two null terminators. To properly format a constant string, you might write it as:

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

or:

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

You should not pass a CString object to this function since it is not possible to have more than one null character in a CString.

Header: afxcmn.h

Show:
© 2015 Microsoft