Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function installs or removes OLE dispatching code from the container's frame window.

Syntax

WINOLEAPI OleSetMenuDescriptor( 
  HOLEMENU 
holemenu, 
  HWND 
hwndFrame, 
  HWND
 hwndActiveObject, 
  LPOLEINPLACEFRAME
 lpFrame, 
  LPOLEINPLACEACTIVEOBJECT 
lpActiveObj 
);

Parameters

holemenu

[in] Handle to the composite menu descriptor returned by the OleCreateMenuDescriptorfunction.

If NULL, the dispatching code is unhooked.

hwndFrame

[in] Handle to the container's frame window where the in-place composite menu is to be installed.

hwndActiveObject

[in] Handle to the object's in-place activation window. OLE dispatches menu messages and commands to this window.

lpFrame

[in] Long pointer to the IOleInPlaceFrameinterface on the container's frame window.

lpActiveObj

[in] Long pointer to the IOleInPlaceActiveObjectinterface on the active in-place object.

Return Value

The following HRESULT values can be returned.

Value Description

S_OK

The menu was correctly installed.

E_FAIL

The function has failed.

E_INVALIDARG

The function has failed.

E_UNEXPECTED

The function has failed.

Remarks

The hwndActiveObjectand the lpActiveObjparameters are not supported. Set to NULL.

The container should call OleSetMenuDescriptorto install the dispatching code on hwndFramewhen the object calls the IOleInPlaceFrame::SetMenumethod, or to remove the dispatching code by passing NULL as the value for holemenuto OleSetMenuDescriptor.

If the lpFrameand lpActiveObjparameters are non-NULL, OLE installs the context-sensitive help F1 message filter for the application. Otherwise, the application must supply its own message filter.

To determine whether the platform supports this function, see Determining Supported COM APIs.

Requirements

Header ole2.h
Library ole32.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also