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
‘선언
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
‘사용 방법
Dim instance As IOleInPlaceComponent
Dim pdwRole As UInteger
Dim pclsid As Guid
Dim pszTitleIn As String
Dim pszTextIn As String
Dim pszHelpFileIn As String
Dim ppszTitleOut As String
Dim ppszTextOut As String
Dim ppszHelpFileOut As String
Dim pdwHelpContextID As UInteger
Dim pmsgbtn As OLEMSGBUTTON()
Dim pmsgdefbtn As OLEMSGDEFBUTTON()
Dim pmsgicon As OLEMSGICON()
Dim pfSysAlert As Integer
Dim returnValue As Integer
returnValue = instance.GetCntrMessage(pdwRole, _
pclsid, pszTitleIn, pszTextIn, pszHelpFileIn, _
ppszTitleOut, ppszTextOut, ppszHelpFileOut, _
pdwHelpContextID, pmsgbtn, pmsgdefbtn, _
pmsgicon, pfSysAlert)
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: System.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: System.Guid%
[in] Specifies the class identifier (CLSID) of the in-place object requesting the message display.
- pszTitleIn
Type: System.String
[in] Points to the title of the message.
- pszTextIn
Type: System.String
[in] Points to the text of the message.
- pszHelpFileIn
Type: System.String
[in] Points to a help file containing the message.
- ppszTitleOut
Type: System.String%
[out] Pointer to the title that was displayed.
- ppszTextOut
Type: System.String%
[out] Pointer to the text that was displayed.
- ppszHelpFileOut
Type: System.String%
[out] Pointer to the help file that was displayed.
- pdwHelpContextID
Type: System.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.
- pmsgicon
Type: array<Microsoft.VisualStudio.Shell.Interop.OLEMSGICON[]
[in][out] On input, pointer to the type of message to be displayed. On output, the pmsgicon parameter is a pointer to the type of message that was displayed. For a list of valid pmsgicon values, see OLEMSGICON.
- pfSysAlert
Type: System.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: 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::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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.