Represents COM errors that occur during application execution. COMException is the base class for a set of predefined, standard exceptions.
public ref class COMException : Exception, IException, IPrintable, IEquatableThe COMException class inherits from the Object class and the IException, IPrintable, and IEquatable interfaces.
COMException also has the following types of members.
Constructors
| Member | Description |
|---|---|
| COMException | Initializes a new instance of the COMException class. |
Methods
The COMException class inherits the Equals(), Finalize(), GetHashCode(), GetType(), MemberwiseClose(), and ToString() methods from the Platform::Object Class.
Properties
The COMException class has the following properties.
| Member | Description |
|---|---|
| Exception::HResult | The HRESULT that corresponds to the exception. |
| Exception::Message | Message that describes the exception. |
The following predefined exceptions are derived from COMException. They differ from COMException only in their name, the name of their constructor, and their underlying HRESULT value.
Minimum supported client: Windows 8
Minimum supported server: Windows Server 2012
Namespace: Platform
Metadata: platform.winmd
Initializes a new instance of the COMException class.
COMException(int hresult);hresult
The error HRESULT that is represented by the exception.
The HRESULT that corresponds to the exception.
public:
property int HResult { int get(); }An HRESULT value that specifies the error.
For more information about how to interpret the HRESULT value, see Structure of COM Error Codes.
Message that describes the exception.
public:
property String^ Message { String^ get(); }A description of the exception.
