You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
Name
Underlying HRESULT
Description
COMException
user-defined hresult
Thrown when an unrecognized HRESULT is returned from a COM method call.
AccessDeniedException
E_ACCESSDENIED
Thrown when access is denied to a resource or feature.
ChangedStateException
E_CHANGED_STATE
Thrown when methods of a collection iterator or a collection view are called after the parent collection has changed, invalidating the results of the method.
ClassNotRegisteredException
REGDB_E_CLASSNOTREG
Thrown when a COM class has not been registered.
DisconnectedException
RPC_E_DISCONNECTED
Thrown when an object is disconnected from its clients.
FailureException
E_FAIL
Thrown when an operation fails.
InvalidArgumentException
E_INVALIDARG
Thrown when one of the arguments provided to a method is not valid.
InvalidCastException
E_NOINTERFACE
Thrown when a type can't be cast to another type.
NotImplementedException
E_NOTIMPL
Thrown if an interface method hasn't been implemented on a class.
NullReferenceException
E_POINTER
Thrown when there is an attempt to dereference a null object reference.
OperationCanceledException
E_ABORT
Thrown when an operation is aborted.
OutOfBoundsException
E_BOUNDS
Thrown when an operation attempts to access data outside the valid range.
OutOfMemoryException
E_OUTOFMEMORY
Thrown when there's insufficient memory to complete the operation.
Requirements
Minimum supported client: Windows 8
Minimum supported server: Windows Server 2012
Namespace: Platform
Metadata: platform.winmd
COMException::COMException Constructor
Intializes a new instance of the COMException class.
Syntax
COMException( int hresult )
Parameters
hresult
The error HRESULT that is represented by the exception.