IOleObject::EnumVerbs

This method exposes a pull-down menu listing the verbs available for an object in ascending order by verb number.

HRESULT EnumVerbs( 
IEnumOleVerb **ppEnumOleVerb);

Parameters

  • ppEnumOleVerb
    [out] Address of IEnumOleVerb* pointer variable that receives the interface pointer to the new enumerator object. Each time an object receives a call to EnumVerbs, it must increase the reference count on *ppEnumOleVerb. It is the callers responsibility to call Release when it is done with *ppEnumOleVerb. If an error occurs, *ppEnumOleVerb must be set to NULL.

Return Values

One of the values described in the following table is returned.

Value Description
S_OK Verb(s) enumerated successfully.
OLE_S_USEREG Delegate to the default handler to use the entries in the registry to provide the enumeration.
OLEOBJ_E_NOVERBS Object does not support any verbs.

Remarks

Notes to Callers

Containers call this method to expose a pull-down menu of the verbs available for their embedded objects. You may want your container to call IOleObject::EnumVerbs each and every time such a menu is selected in order to enable such objects as media clips, whose verbs may change while they are running, to update their menus. The default verb for a media clip, for example, changes from Play before it is activated to Stop once it is running.

Notes to Implementers

The default handlers implementation of IOleObject::EnumVerbs uses the registry to enumerate an objects verbs. If an object application is to use the default handlers implementation, it should return OLE_S_USEREG.

The enumeration returned is of type IEnumOLEVERB:

typedef Enum < OLEVERB > IEnumOLEVERB; 
 

where OLEVERB is defined as:

typedef struct tagOLEVERB 
{ 
    LONG    iVerb; 
    LPOLESTR   lpszVerbName; 
    DWORD   fuFlags; 
    DWORD   grfAttribs; 
} OLEVERB; 
 

The following list describes the members of the OLEVERB structure:

  • iVerb
    Verb number being enumerated. If the object supports OLEIVERB_OPEN, OLEIVERB_SHOW and/or OLEIVERB_HIDE (or another predefined verb), these will be the first verbs enumerated, since they have the lowest verb numbers.

  • lpszVerbName
    Long pointer to the null-terminated string that contains the name of the verb.

    In Windows, this value, along with optional embedded ampersand characters to indicate accelerator keys, can be passed to the AppendMenu function.

    On the Macintosh, the following metacharacters may be passed along with this value:

    • ! marks the menu item with the subsequent character
    • < sets the character style of the item
    • ( disables the item.

    The metacharacters / and ^ are not permitted.

  • fuFlags
    In Windows, a group of flags taken from the flag constants beginning with MF_ defined in AppendMenu. Containers should use these flags in building an objects verb menu. All flags defined in AppendMenu are supported except for MF_BITMAP, MF_OWNERDRAW, and MF_POPUP.

  • grfAttribs
    In Windows, a group of flag bits taken from the enumeration OLEVERBATTRIB. The flag OLEVERBATTRIB_NEVERDIRTIES indicates that executing this verb will not cause the object to become dirty and is therefore in need of saving to persistent storage.

    OLEVERBATTRIB_ONCONTAINERMENU indicates that this verb should be placed on the containers menu of object verbs when the object is selected. OLEIVERB_HIDE, OLEIVERB_SHOW, and OLEIVERB_OPEN never have this value set.

For more information on the Windows AppendMenu function, see the Microsoft Win32 SDK.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Oleidl.h    

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.