BOOL LoadMenuIndirect( const void* lpMenuTemplate );
Return Value
Nonzero if the menu resource was loaded successfully; otherwise 0.
Parameters
lpMenuTemplate
Points to a menu template (which is a single MENUITEMTEMPLATEHEADER structure and a collection of one or more MENUITEMTEMPLATE structures). For more information on these two structures, see the Win32 SDK documentation.
Remarks
Loads a resource from a menu template in memory and attaches it to the CMenu object. A menu template is a header followed by a collection of one or more MENUITEMTEMPLATE structures, each of which may contain one or more menu items and pop-up menus.
The version number should be 0.
The mtOption flags should include MF_END for the last item in a pop-up list and for the last item in the main list. See the AppendMenu member function for other flags. The mtId member must be omitted from the MENUITEMTEMPLATE structure when MF_POPUP is specified in mtOption.
The space allocated for the MENUITEMTEMPLATE structure must be large enough for mtString to contain the name of the menu item as a null-terminated string.
Before exiting, an application must free system resources associated with a menu if the menu is not assigned to a window. An application frees a menu by calling the DestroyMenu member function.
CMenu Overview | Class Members | Hierarchy Chart
See Also CMenu::DestroyMenu, CMenu::LoadMenu, ::LoadMenuIndirect, CMenu::AppendMenu