Partager via


COleClientItem::OnSetMenu

Called by the framework two times when in-place activation begins and ends; the first time to install the composite menu and the second time (with holemenu equal to NULL) to remove it.

virtual void OnSetMenu( 
   CMenu* pMenuShared, 
   HOLEMENU holemenu, 
   HWND hwndActiveObject  
);

Parameters

  • pMenuShared
    Pointer to the composite menu constructed by calls to the OnInsertMenus member function and the InsertMenu function.

  • holemenu
    Handle to the menu descriptor returned by the OleCreateMenuDescriptor function, or NULL if the dispatching code is to be removed.

  • hwndActiveObject
    Handle to the editing window for the OLE item. This is the window that will receive editing commands from OLE.

Remarks

The default implementation installs or removes the composite menu and then calls the OleSetMenuDescriptor function to install or remove the dispatching code. Override this function if the default implementation is not appropriate for your application. If you override this function, you should probably override OnInsertMenus and OnRemoveMenus as well. This is an advanced overridable.

For more information, see OleCreateMenuDescriptor, OleSetMenuDescriptor, and IOleInPlaceFrame::SetMenu in the Windows SDK.

Requirements

Header: afxole.h

See Also

Reference

COleClientItem Class

Hierarchy Chart

COleClientItem::OnInsertMenus

COleClientItem::OnRemoveMenus