Compartir a través de


IOleInPlaceComponent.GetCntrMessage Method

Allows an in-place VSPackage object assuming the main component role to override a message belonging to 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

'Declaration
Function GetCntrMessage ( _
    <OutAttribute> ByRef pdwRole As UInteger, _
    <OutAttribute> ByRef pclsid As Guid, _
    pszTitleIn As String, _
    pszTextIn As String, _
    pszHelpFileIn As String, _
    <OutAttribute> ByRef ppszTitleOut As String, _
    <OutAttribute> ByRef ppszTextOut As String, _
    <OutAttribute> ByRef ppszHelpFileOut As String, _
    <OutAttribute> ByRef pdwHelpContextID As UInteger, _
    <OutAttribute> pmsgbtn As OLEMSGBUTTON(), _
    <OutAttribute> pmsgdefbtn As OLEMSGDEFBUTTON(), _
    <OutAttribute> pmsgicon As OLEMSGICON(), _
    <OutAttribute> ByRef pfSysAlert As Integer _
) As Integer
int GetCntrMessage(
    out uint pdwRole,
    out Guid pclsid,
    string pszTitleIn,
    string pszTextIn,
    string pszHelpFileIn,
    out string ppszTitleOut,
    out string ppszTextOut,
    out string ppszHelpFileOut,
    out uint pdwHelpContextID,
    OLEMSGBUTTON[] pmsgbtn,
    OLEMSGDEFBUTTON[] pmsgdefbtn,
    OLEMSGICON[] pmsgicon,
    out int pfSysAlert
)
int GetCntrMessage(
    [InAttribute] [OutAttribute] unsigned int% pdwRole, 
    [InAttribute] [OutAttribute] Guid% pclsid, 
    [InAttribute] String^ pszTitleIn, 
    [InAttribute] String^ pszTextIn, 
    [InAttribute] String^ pszHelpFileIn, 
    [OutAttribute] String^% ppszTitleOut, 
    [OutAttribute] String^% ppszTextOut, 
    [OutAttribute] String^% ppszHelpFileOut, 
    [InAttribute] [OutAttribute] unsigned int% pdwHelpContextID, 
    [InAttribute] [OutAttribute] array<OLEMSGBUTTON>^ pmsgbtn, 
    [InAttribute] [OutAttribute] array<OLEMSGDEFBUTTON>^ pmsgdefbtn, 
    [InAttribute] [OutAttribute] array<OLEMSGICON>^ pmsgicon, 
    [InAttribute] [OutAttribute] int% pfSysAlert
)
abstract GetCntrMessage : 
        pdwRole:uint32 byref * 
        pclsid:Guid byref * 
        pszTitleIn:string * 
        pszTextIn:string * 
        pszHelpFileIn:string * 
        ppszTitleOut:string byref * 
        ppszTextOut:string byref * 
        ppszHelpFileOut:string byref * 
        pdwHelpContextID:uint32 byref * 
        pmsgbtn:OLEMSGBUTTON[] byref * 
        pmsgdefbtn:OLEMSGDEFBUTTON[] byref * 
        pmsgicon:OLEMSGICON[] byref * 
        pfSysAlert:int byref -> int
function GetCntrMessage(
    pdwRole : uint, 
    pclsid : Guid, 
    pszTitleIn : String, 
    pszTextIn : String, 
    pszHelpFileIn : String, 
    ppszTitleOut : String, 
    ppszTextOut : String, 
    ppszHelpFileOut : String, 
    pdwHelpContextID : uint, 
    pmsgbtn : OLEMSGBUTTON[], 
    pmsgdefbtn : OLEMSGDEFBUTTON[], 
    pmsgicon : OLEMSGICON[], 
    pfSysAlert : int
) : int

Parameters

  • pdwRole
    Type: UInt32%

    [in][out] On input, pointer to the role of the in-place object requesting the message display. On output, the pdwRole parameter is the pointer to the role of the in-place object responsible for the message display. For a list of valid pdwRole values, see OLEROLE.

  • pclsid
    Type: Guid%

    [in] Specifies the class identifier (CLSID) of the in-place object requesting the message display.

  • pszTitleIn
    Type: String

    [in] Points to the title of the message.

  • pszTextIn
    Type: String

    [in] Points to the text of the message.

  • pszHelpFileIn
    Type: String

    [in] Points to a help file containing the message.

  • ppszTitleOut
    Type: String%

    [out] Pointer to the title that was displayed.

  • ppszTextOut
    Type: String%

    [out] Pointer to the text that was displayed.

  • ppszHelpFileOut
    Type: String%

    [out] Pointer to the help file that was displayed.

  • pdwHelpContextID
    Type: UInt32%

    [in][out] On input, pointer to the requested help context identifier. On output, the pdwHelpContextId parameter is a pointer to the help context identifier used for the message display.

  • pmsgbtn
    Type: array<Microsoft.VisualStudio.Shell.Interop.OLEMSGBUTTON[]

    [in][out] On input, pointer to the type of buttons to be displayed with the message. On output, the pmsgbtn parameter is a pointer to the type buttons actually displayed with the message. For a list of valid pmsgbtn values, see OLEMSGBUTTON.

  • pmsgdefbtn
    Type: array<Microsoft.VisualStudio.Shell.Interop.OLEMSGDEFBUTTON[]

    [in][out] On input, pointer to the requested position of the default button in the message's button group. On output, the pmsgdefbtn parameter is a pointer to the actual position of the default button. For a list of valid pmsgdefbtn values, see OLEMSGDEFBUTTON.

  • pfSysAlert
    Type: Int32%

    [in][out] If true, this flag causes the MB_SYSTEMMODAL flag to be set when showing the message. If false, no system flag is set during the message display.

Return Value

Type: 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::GetCntrMessage(
   [in][out] DWORD *pdwRole,
   [in][out] CLSID *pclsid,
   [in] LPOLESTR pszTitleIn,
   [in] LPOLESTR pszTextIn,
   [in] LPOLESTR pszHelpFileIn,
   [out] LPOLESTR *ppszTitleOut,
   [out] LPOLESTR *ppszTextOut,
   [out] LPOLESTR *ppszHelpFileOut,
   [in][out] DWORD *pdwHelpContextID,
   [in][out] OLEMSGBUTTON *pmsgbtn,
   [in][out] OLEMSGDEFBUTTON *pmsgdefbtn,
   [in][out] OLEMSGICON *pmsgicon,
   [in][out] BOOL *pfSysAlert
);

An in-place object assuming the role of main component is given a chance to override any aspect of a message provided by a subcomponent or component control, including the help file name, message text, and message type. If the main component wants to override the message text or the help file name, it must allocate strings using the active IMalloc allocator supplied by OLE. The environment will free these strings using IMalloc.

.NET Framework Security

See Also

Reference

IOleInPlaceComponent Interface

Microsoft.VisualStudio.Shell.Interop Namespace