XLL+ Class Library

CXlMenu::Create

Adds the menu or sub-menu to the Excel main application menu bar

[C++]
BOOL Create(
   const char* pszNextMenu = "Help"
);
BOOL Create(
   const CXlMenu& menuParent,
   const char* pszNextItem
);
BOOL Create(
   const CXlMenu& menuParent,
   int nNextItem
);

Parameters

pszNextMenu

The name of the existing menu before which this menu will appear.

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.

menuParent

The parent menu to which this menu will be attached. The parent must already have called Create().

pszNextItem

The name of the existing item before which this sub-menu will appear.

nNextItem

The index of the existing item before which this sub-menu will appear. Note that the index of the first item is 1.

Return value

Returns TRUE if the call is successful, FALSE if it fails.

Remarks

Create the new menu. This function should be called during the OnXllOpen() or OnXllOpenEx() event handlers.

Note that the first form creates a new menu in Excel's main application menu bar. The second and third forms create a sub-menu as an item in a menu of the first form.

Requirements

Header: xlmenu.h

See Also

CXlMenu Class | CXlMenu Methods