This documentation is archived and is not being maintained.

IOleInPlaceComponentUIManager.SetActiveUI Method

Allows a UI active VSPackage object to change the menus, toolbars, or commands that are displayed on its behalf by the environment.

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

int SetActiveUI (
	[InAttribute] uint dwCompRole,
	[InAttribute] ref Guid rclsid,
	[InAttribute] uint cCmdGrpId,
	[InAttribute] int[] rgnCmdGrpId
int SetActiveUI (
	/** @attribute InAttribute() */ UInt32 dwCompRole, 
	/** @attribute InAttribute() */ /** @ref */ Guid rclsid, 
	/** @attribute InAttribute() */ UInt32 cCmdGrpId, 
	/** @attribute InAttribute() */ int[] rgnCmdGrpId
JScript does not support passing value-type arguments by reference.



[in] Role of the in-place object requesting the user interface change. For a list of valid dwCompRole values, see OLEROLE.


[in] Class identifier (CLSID) of the in-place object requesting the change.


[in] Count of the toolbars identified by rgnCmdGrpId.


[in] Array of identifiers of toolbars to be displayed in the update.

Return Value

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

COM Signature

From oleipc.idl:

HRESULT IOleInPlaceComponentUIManager::SetActiveUI(
   [in] DWORD dwCompRole,
   [in] REFCLSID rclsid,
   [in] ULONG cCmdGrpId,
   [in] LONG *rgnCmdGrpId