Struct HResult
public readonly struct HResult : IEquatable<HResult>
- Implements
- Inherited Members
- Extension Methods
Fields
False
public static readonly HResult False
Field Value
Ok
public static readonly HResult Ok
Field Value
Methods
Equals(HResult)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(HResult other)
Parameters
otherHResultAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ThrowOnFailure(nint)
Throws an exception with a specific failure HRESULT, based on the specified IErrorInfo interface.
public HResult ThrowOnFailure(nint errorInfo = 0)
Parameters
errorInfonintA pointer to the IErrorInfo interface that provides more information about the error. You can specify
IntPtr(0)to use the current IErrorInfo interface, orIntPtr(-1)to ignore the current IErrorInfo interface and construct the exception just from the error code.
Returns
- See Also
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
ToString(string, IFormatProvider)
public string ToString(string format, IFormatProvider formatProvider)
Parameters
formatstringformatProviderIFormatProvider
Returns
Operators
operator ==(HResult, HResult)
public static bool operator ==(HResult left, HResult right)
Parameters
Returns
implicit operator bool(HResult)
public static implicit operator bool(HResult value)
Parameters
valueHResult
Returns
implicit operator int(HResult)
public static implicit operator int(HResult value)
Parameters
valueHResult
Returns
implicit operator uint(HResult)
public static implicit operator uint(HResult value)
Parameters
valueHResult
Returns
implicit operator HResult(bool)
public static implicit operator HResult(bool value)
Parameters
valuebool
Returns
implicit operator HResult(int)
public static implicit operator HResult(int value)
Parameters
valueint
Returns
implicit operator HResult(uint)
public static implicit operator HResult(uint value)
Parameters
valueuint
Returns
operator !=(HResult, HResult)
public static bool operator !=(HResult left, HResult right)