Freigeben über


COleClientItem::Activate

Call this function to execute the specified verb instead of DoVerb so that you can do your own processing when an exception is thrown.

void Activate(
   LONG nVerb,
   CView* pView,
   LPMSG lpMsg = NULL 
);

Parameters

  • nVerb
    Specifies the verb to execute. It can be 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 container view window that contains the OLE item; this is used by the server application for in-place activation. This parameter should be NULL if the container does not support in-place activation.

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

Remarks

If the server application was written using the Microsoft Foundation Class Library, this function causes the OnDoVerb member function of the corresponding COleServerItem object to be executed.

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.

For more information, see IOleObject::DoVerb in the Windows SDK.

Requirements

Header: afxole.h

See Also

Reference

COleClientItem Class

Hierarchy Chart

COleClientItem::DoVerb

COleServerItem::OnDoVerb

Other Resources

COleClientItem Members