共用方式為


IOleInPlaceComponent.GetCntrHelp Method

Allows an in-place VSPackage object assuming the main component role to override the help topic requested by an object assuming the subcomponent or component control role.

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

Syntax

'宣告
Function GetCntrHelp ( _
    <OutAttribute> ByRef pdwRole As UInteger, _
    <OutAttribute> ByRef pclsid As Guid, _
    posMouse As POINT, _
    dwHelpCmd As UInteger, _
    pszHelpFileIn As String, _
    <OutAttribute> ByRef ppszHelpFileOut As String, _
    dwDataIn As UInteger, _
    <OutAttribute> ByRef pdwDataOut As UInteger _
) As Integer
'用途
Dim instance As IOleInPlaceComponent
Dim pdwRole As UInteger
Dim pclsid As Guid
Dim posMouse As POINT
Dim dwHelpCmd As UInteger
Dim pszHelpFileIn As String
Dim ppszHelpFileOut As String
Dim dwDataIn As UInteger
Dim pdwDataOut As UInteger
Dim returnValue As Integer

returnValue = instance.GetCntrHelp(pdwRole, _
    pclsid, posMouse, dwHelpCmd, pszHelpFileIn, _
    ppszHelpFileOut, dwDataIn, pdwDataOut)
int GetCntrHelp(
    out uint pdwRole,
    out Guid pclsid,
    POINT posMouse,
    uint dwHelpCmd,
    string pszHelpFileIn,
    out string ppszHelpFileOut,
    uint dwDataIn,
    out uint pdwDataOut
)
int GetCntrHelp(
    [InAttribute] [OutAttribute] unsigned int% pdwRole, 
    [InAttribute] [OutAttribute] Guid% pclsid, 
    [InAttribute] POINT posMouse, 
    [InAttribute] unsigned int dwHelpCmd, 
    [InAttribute] String^ pszHelpFileIn, 
    [OutAttribute] String^% ppszHelpFileOut, 
    [InAttribute] unsigned int dwDataIn, 
    [OutAttribute] unsigned int% pdwDataOut
)
abstract GetCntrHelp : 
        pdwRole:uint32 byref * 
        pclsid:Guid byref * 
        posMouse:POINT * 
        dwHelpCmd:uint32 * 
        pszHelpFileIn:string * 
        ppszHelpFileOut:string byref * 
        dwDataIn:uint32 * 
        pdwDataOut:uint32 byref -> int 
function GetCntrHelp(
    pdwRole : uint, 
    pclsid : Guid, 
    posMouse : POINT, 
    dwHelpCmd : uint, 
    pszHelpFileIn : String, 
    ppszHelpFileOut : String, 
    dwDataIn : uint, 
    pdwDataOut : uint
) : int

Parameters

  • pdwRole
    Type: System.UInt32%
    [in][out] On input, pointer to the role of the in-place object requesting the help topic. On output, pointer to the role of the in-place object responsible for displaying the help topic. For a list of valid pdwRole values, see OLEROLE.
  • pclsid
    Type: System.Guid%
    [in][out] On input, pointer to the class identifier of the in-place object requesting the help topic. On output, pointer to the class identifier of the in-place object responsible for displaying the help topic.
  • posMouse
    Type: Microsoft.VisualStudio.OLE.Interop.POINT
    [in] Specifies the position of the mouse. Mouse position can be useful for user interface modes that display help for a user interface element instead of executing the command associated with that element.
  • dwHelpCmd
    Type: System.UInt32
    [in] Specifies the help topic to display.
  • pszHelpFileIn
    Type: System.String
    [in] Pointer to a help file to display.
  • ppszHelpFileOut
    Type: System.String%
    [out] Pointer to the help file that was displayed.
  • dwDataIn
    Type: System.UInt32
    [in] Specifies help data to display.
  • pdwDataOut
    Type: System.UInt32%
    [out] Pointer to the help data that was displayed.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From oleipc.idl:

HRESULT IOleInPlaceComponent::GetCntrHelp(
   [in][out] DWORD *pdwRole,
   [in][out] CLSID *pclsid,
   [in] POINT posMouse,
   [in] DWORD dwHelpCmd,
   [in] LPOLESTR pszHelpFileIn,
   [out] LPOLESTR *ppszHelpFileOut,
   [in] DWORD dwDataIn,
   [out] DWORD *pdwDataOut
);

An in-place VSPackage object acting as a main component can override the help file and/or help context of a subcomponent or component control in-place object.

The environment is responsible for freeing the OUT string parameters using the active OLE IMalloc allocator.

Typically, most in-place objects return S_OK from this method and use the Dynamic Help window support for showing help topics (VSUC_Usage_LookupF1).

.NET Framework Security

See Also

Reference

IOleInPlaceComponent Interface

IOleInPlaceComponent Members

Microsoft.VisualStudio.Shell.Interop Namespace