IOleInPlaceComponent::UseComponentUIManager Method (UInt32, UInt32, IOleComponentUIManager^, IOleInPlaceComponentSite^)

 

Informs an in-place object of its role in the environment, providing pointers to the IOleComponentUIManager and IOleInPlaceComponentSite interfaces.

Namespace:   Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

int UseComponentUIManager(
	unsigned int dwCompRole,
	[OutAttribute] unsigned int% pgrfCompFlags,
	IOleComponentUIManager^ pCompUIMgr,
	IOleInPlaceComponentSite^ pIPCompSite
)

Parameters

dwCompRole
Type: System::UInt32

[in] Specifies the role that the in-place object is to assume in the environment. The default role is OLEROLE_COMPONENTCONTROL. For a list of all valid dwCompRole values, see OLEROLE.

pgrfCompFlags
Type: System::UInt32

[in] Flags specified by the in-place object to control interactions with the environment. For a list of pgrfCompFlags values, see OLECOMPFLAG.

pCompUIMgr
Type: Microsoft.VisualStudio.Shell.Interop::IOleComponentUIManager^

[in] Pointer to the environment's IOleComponentUIManager interface.

pIPCompSite
Type: Microsoft.VisualStudio.Shell.Interop::IOleInPlaceComponentSite^

[in] Pointer to the environment's IOleInPlaceComponentSite interface.

Return Value

Type: System::Int32

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

From oleipc.idl:

HRESULT IOleInPlaceComponent::UseComponentUIManager(
   [in] DWORD dwCompRole,
   [out] DWORD *pgrfCompFlags,
   [in] IOleComponentUIManager *pCompUIMgr,
   [in] IOleInPlaceComponentSite *pIPCompSite
);

The environment calls an in-place object's UseComponentUIManager method before the object becomes in-place active. In-place VSPackage objects activate by responding to methods such as DoVerb or UIActivate. UseComponentUIManager directs the in-place object to assume the role specified by the dwCompRole parameter.

In-place objects do not need to call UseComponentUIManager when they re-activate after having deactivated. They only need to call it a single time.

VSPackages typically implement UseComponentUIManager to use the pointer passed in the pCompUIMgr parameter to call QueryInterface and retrieve a pointer to the environment's IOleInPlaceComponentUIManager interface.

Return to top
Show: