Partager via


IVsUIShell.ReportErrorInfo Method

Helper method that displays an error message to the user.

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

Syntax

'Déclaration
Function ReportErrorInfo ( _
    hr As Integer _
) As Integer
'Utilisation
Dim instance As IVsUIShell
Dim hr As Integer
Dim returnValue As Integer

returnValue = instance.ReportErrorInfo(hr)
int ReportErrorInfo(
    int hr
)
int ReportErrorInfo(
    [InAttribute] int hr
)
function ReportErrorInfo(
    hr : int
) : int

Parameters

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 vsshell.idl:

HRESULT IVsUIShell::ReportErrorInfo(
   [in] HRESULT hr
);

This method is generally called by the environment to report any error objects passed to it from a VSPackage. Any VSPackage can use this method internal to its own implementation, but most failures in a VSPackage are propagated to the environment to report.

The message to be displayed should be previously stashed away by a call to the Win32 SetErrorInfo API (or a call to the helper method SetErrorInfo). If the HRESULT is a standard system error code and there is no specific error message set aside through a call to SetErrorInfo, then the standard system error message is displayed.

Permissions

See Also

Reference

IVsUIShell Interface

IVsUIShell Members

Microsoft.VisualStudio.Shell.Interop Namespace