Checks if the parameter is a success or failure HRESULT and throws an exception in case of failure.
Namespace: Microsoft.VisualStudio
Assembly: Microsoft.VisualStudio.Shell (in Microsoft.VisualStudio.Shell.dll)
Syntax
'宣言
Public Shared Function ThrowOnFailure ( _
hr As Integer _
) As Integer
'使用
Dim hr As Integer
Dim returnValue As Integer
returnValue = ErrorHandler.ThrowOnFailure(hr)
public static int ThrowOnFailure(
int hr
)
public:
static int ThrowOnFailure(
int hr
)
public static function ThrowOnFailure(
hr : int
) : int
Parameters
hr
Type: System.Int32The HRESULT to test.
Return Value
Type: System.Int32
The HRESULT.
Permissions
- 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.
See Also
Concepts
HRESULT Information in Managed Code