OleUIAddVerbMenuA function (oledlg.h)

Adds the Verb menu for the specified object to the specified menu.

Syntax

BOOL OleUIAddVerbMenuA(
  [in, optional] LPOLEOBJECT lpOleObj,
  [in, optional] LPCSTR      lpszShortType,
  [in]           HMENU       hMenu,
  [in]           UINT        uPos,
  [in]           UINT        uIDVerbMin,
  [in]           UINT        uIDVerbMax,
  [in]           BOOL        bAddConvert,
  [in]           UINT        idConvert,
  [out]          HMENU       *lphMenu
);

Parameters

[in, optional] lpOleObj

Pointer to the IOleObject interface on the selected object. If this is NULL, then a default disabled menu item is created.

[in, optional] lpszShortType

Pointer to the short name defined in the registry (AuxName==2) for the object identified with lpOleObj. If the string is not known, then NULL may be passed. If NULL is passed, IOleObject::GetUserType is called to retrieve it. If the caller has easy access to the string, it is faster to pass it in.

[in] hMenu

Handle to the menu in which to make modifications.

[in] uPos

Position of the menu item.

[in] uIDVerbMin

The identifier value at which to start the verbs.

[in] uIDVerbMax

The maximum identifier value to be used for object verbs. If uIDVerbMax is 0, then no maximum identifier value is used.

[in] bAddConvert

Indicates whether to add a Convert item to the bottom of the menu (preceded by a separator).

[in] idConvert

The identifier value to use for the Convert menu item, if bAddConvert is TRUE.

[out] lphMenu

An HMENU pointer to the cascading verb menu if it's created. If there is only one verb, this will be filled with NULL.

Return value

This function returns TRUE if lpOleObj was valid and at least one verb was added to the menu. A FALSE return indicates that lpOleObj was NULL and a disabled default menu item was created.

Remarks

If the object has one verb, the verb is added directly to the given menu.

Note

The oledlg.h header defines OleUIAddVerbMenu as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header oledlg.h
Library OleDlg.lib
DLL OleDlg.dll