[]
Result structure for COM methods.
public struct HResult : IEquatable<HResult>
Initializes a new instance of the HResult struct.
public HResult(int code)
code
intThe HRESULT error code.
Initializes a new instance of the HResult struct.
[CLSCompliant(false)]
public HResult(uint code)
code
uintThe HRESULT error code.
Result code Abort.
public static HResult Abort
Result code AccessDenied.
public static HResult AccessDenied
Result code Fail.
public static HResult Fail
Result code False.
public static HResult False
Result code Handle.
public static HResult Handle
The data area passed to a system call is too small.
public static HResult InsufficientBuffer
Result code invalid argument.
public static HResult InvalidArg
Result code Invalid pointer.
public static HResult InvalidPointer
Result code no interface.
public static HResult NoInterface
Result code not implemented.
public static HResult NotImplemented
Result code Ok.
public static HResult Ok
Result code out of memory.
public static HResult OutOfMemory
Unexpected failure.
public static HResult UnexpectedFailure
Result of a wait abandonned.
public static HResult WaitAbandoned
Result of a wait timeout.
public static HResult WaitTimeout
Gets the HRESULT error code.
public int Code { get; }
The HRESULT error code.
Gets a value indicating whether this HResult is failure.
public bool Failure { get; }
true
if failure; otherwise, false
.
Gets a value indicating whether this HResult is success.
public bool Success { get; }
true
if success; otherwise, false
.
Checks the error.
public void CheckError()
Equalses the specified other.
public bool Equals(HResult other)
other
HResultThe other.
Determines whether the specified object is equal to this instance.
public override bool Equals(object obj)
obj
objectThe object to compare with this instance.
true
if the specified object is equal to this instance; otherwise, false
.
Returns a hash code for this instance.
public override int GetHashCode()
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Gets a HResult from an System.Exception.
public static HResult GetResultFromException(Exception ex)
ex
System.ExceptionThe exception
The associated result code
Gets the result from win32 error.
public static HResult GetResultFromWin32Error(int win32Error)
win32Error
intThe win32Error.
A HRESULT.
Returns a string that represents this instance.
public override string ToString()
A string that represents this instance.
Implements the operator ==.
public static bool operator ==(HResult left, HResult right)
The result of the operator.
Performs an implicit conversion from HResult to int.
public static explicit operator int(HResult result)
result
HResultThe result.
The result of the conversion.
Performs an implicit conversion from HResult to uint.
[CLSCompliant(false)]
public static explicit operator uint(HResult result)
result
HResultThe result.
The result of the conversion.
Performs an implicit conversion from int to HResult.
public static implicit operator HResult(int result)
result
intThe result.
The result of the conversion.
Performs an implicit conversion from uint to HResult.
[CLSCompliant(false)]
public static implicit operator HResult(uint result)
result
uintThe result.
The result of the conversion.
Implements the operator !=.
public static bool operator !=(HResult left, HResult right)
The result of the operator.