XLL+ Class Library (6.3)

CXlMenu::AddItem

Adds a menu item

void AddItem(
   const TCHAR* pszText,
   const TCHAR* pszMacro,
   const TCHAR* pszDescription = 0
);

Parameters

pszText

The text of the new menu item, which may include an ampersand for a short-cut key.

To create a separator item, with no text, pass "-" as pszText.

This argument can contain a resource ID string. This will be replaced at run-time by a string loaded from the resource file in the current preferred language, as returned by XllGetStringLanguageID.

pszMacro

The name of the macro function which will be called by the menu. This should be marked in the XLL+ Function Wizard as a macro function.

pszDescription

Optional description which will appear on the status bar in some versions of Excel.

This argument can contain a resource ID string. This will be replaced at run-time by a string loaded from the resource file in the current preferred language, as returned by XllGetStringLanguageID.

Remarks

Adds an item to the menu.

Unlike any of the other item methods, this function may be called either before or after Create() has been called.

Requirements

Header: xlmenu.h

See Also

CXlMenu Class | CXlMenu Methods