Udostępnij za pośrednictwem


IOleInPlaceComponent.UseComponentUIManager Method

Definition

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

public:
 int UseComponentUIManager(System::UInt32 dwCompRole, [Runtime::InteropServices::Out] System::UInt32 % pgrfCompFlags, Microsoft::VisualStudio::Shell::Interop::IOleComponentUIManager ^ pCompUIMgr, Microsoft::VisualStudio::Shell::Interop::IOleInPlaceComponentSite ^ pIPCompSite);
int UseComponentUIManager(unsigned int dwCompRole, [Runtime::InteropServices::Out] unsigned int & pgrfCompFlags, Microsoft::VisualStudio::Shell::Interop::IOleComponentUIManager const & pCompUIMgr, Microsoft::VisualStudio::Shell::Interop::IOleInPlaceComponentSite const & pIPCompSite);
public int UseComponentUIManager (uint dwCompRole, out uint pgrfCompFlags, Microsoft.VisualStudio.Shell.Interop.IOleComponentUIManager pCompUIMgr, Microsoft.VisualStudio.Shell.Interop.IOleInPlaceComponentSite pIPCompSite);
abstract member UseComponentUIManager : uint32 * uint32 * Microsoft.VisualStudio.Shell.Interop.IOleComponentUIManager * Microsoft.VisualStudio.Shell.Interop.IOleInPlaceComponentSite -> int
Public Function UseComponentUIManager (dwCompRole As UInteger, ByRef pgrfCompFlags As UInteger, pCompUIMgr As IOleComponentUIManager, pIPCompSite As IOleInPlaceComponentSite) As Integer

Parameters

dwCompRole
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
UInt32

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

pCompUIMgr
IOleComponentUIManager

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

pIPCompSite
IOleInPlaceComponentSite

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

Returns

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

Remarks

COM Signature

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.

Applies to