Share via


COleClientItem::DoVerb

Call DoVerb to execute the specified verb.

virtual BOOL DoVerb( 
   LONG nVerb, 
   CView* pView,
   LPMSG lpMsg = NULL  
);

Parameters

  • nVerb
    Specifies the verb to execute. It can include one of the following:

    Value

    Meaning

    Symbol

    – 0

    Primary verb

    OLEIVERB_PRIMARY

    – 1

    Secondary verb

    (None)

    – 1

    Display item for editing

    OLEIVERB_SHOW

    – 2

    Edit item in separate window

    OLEIVERB_OPEN

    – 3

    Hide item

    OLEIVERB_HIDE

    The –1 value is typically an alias for another verb. If open editing is not supported, –2 has the same effect as –1. For additional values, see IOleObject::DoVerb in the Windows SDK.

  • pView
    Pointer to the view window; this is used by the server for in-place activation. This parameter should be NULL if the container application does not allow in-place activation.

  • lpMsg
    Pointer to the message that caused the item to be activated.

Return Value

Nonzero if the verb was successfully executed; otherwise 0.

Remarks

This function calls the Activate member function to execute the verb. It also catches exceptions and displays a message box to the user if one is thrown.

If the primary verb is Edit and zero is specified in the nVerb parameter, the server application is launched to allow the OLE item to be edited. If the container application supports in-place activation, editing can be done in place. If the container does not support in-place activation (or if the Open verb is specified), the server is launched in a separate window and editing can be done there. Typically, when the user of the container application double-clicks the OLE item, the value for the primary verb in the nVerb parameter determines which action the user can take. However, if the server supports only one action, it takes that action, no matter which value is specified in the nVerb parameter.

Requirements

Header: afxole.h

See Also

Reference

COleClientItem Class

Hierarchy Chart

COleClientItem::Activate

Other Resources

COleClientItem Members