Responding to End-User Actions

The host calls the DoVerb method of IOleObject in response to end-user actions such as mouse clicks. In return, the ActiveX Designer performs some action, either an action predefined by OLE or a custom action defined and implemented by the designer.

Predefined verbs are listed in the table that follows. Except for OLEIVERB_PRIMARY, all the predefined verbs have negative values. ActiveX Designers need not support all the predefined verbs. Whenever DoVerb is called with a negative value that the designer does not recognize, the designer should ignore the call and return E_NOTIMPL.

Positive values are reserved for custom verbs specific to the application. For example, an ActiveX Designer might define a custom verb that displays a code window, to be applied when the user selects an object that can have code behind it. When DoVerb is called with a positive value the designer doesn't recognize, it should treat the unknown verb as if it were the primary verb (OLEIVERB_PRIMARY) and return OLE_S_INVALIDVERB.

Verb

Value

Description

OLEIVERB_PRIMARY

0L

Action that occurs when a user double-clicks the object. ActiveX Designers should activate the object in place.

OLEIVERB_SHOW

– 1

Instructs the object to show itself for editing or viewing.

OLEIVERB_OPEN

– 2

Instructs the object to open itself in a new window. ActiveX Designers may choose to ignore this verb.

OLEIVERB_HIDE

– 3

Removes the object's user interface from view.

OLEIVERB_UIACTIVATE

– 4

Activates the object in place, along with its complete set of user interface tools.

OLEIVERB_INPLACEACTIVATE

– 5

Activates the object in place without its user interface tools.

OLEIVERB_DISCARDUNDOSTATE

– 6

Instructs the object to discard any "Undo" information.