Condividi tramite


ErrorHandler.ThrowOnFailure Method (Int32)

Checks if the parameter is a success or failure HRESULT and throws an exception in case of failure.

Namespace:  Microsoft.VisualStudio
Assemblies:   Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)
  Microsoft.VisualStudio.Shell.9.0 (in Microsoft.VisualStudio.Shell.9.0.dll)
  Microsoft.VisualStudio.Shell (in Microsoft.VisualStudio.Shell.dll)

Syntax

'Dichiarazione
Public Shared Function ThrowOnFailure ( _
    hr As Integer _
) As Integer
'Utilizzo
Dim hr As Integer
Dim returnValue As Integer

returnValue = ErrorHandler.ThrowOnFailure(hr)
public static int ThrowOnFailure(
    int hr
)
public:
static int ThrowOnFailure(
    int hr
)
static member ThrowOnFailure : 
        hr:int -> int 
public static function ThrowOnFailure(
    hr : int
) : int

Parameters

Return Value

Type: System.Int32
The HRESULT.

.NET Framework Security

See Also

Reference

ErrorHandler Class

ErrorHandler Members

ThrowOnFailure Overload

Microsoft.VisualStudio Namespace

Other Resources

HRESULT Information in Managed Code