Name
COMException
Synopsis
When a COM error occurs, .NET tries to map it to an exception in the .NET Framework and throws that exception. If the COM error does not map to any exception in the .NET Framework, this exception is thrown instead. It’s the “couldn’t find an exception” exception.
public class COMException : ExternalException { // Public Constructors public COMException( ); public COMException(stringmessage
); public COMException(stringmessage
, Exceptioninner
); public COMException(stringmessage
, interrorCode
); // Protected Constructors protected COMException(System.Runtime.Serialization.SerializationInfoinfo
, System.Runtime.Serialization.StreamingContextcontext
); // Public Instance Methods public override string ToString( ); // overrides Exception }
Hierarchy
System.Object
→
System.Exception(System.Runtime.Serialization.ISerializable)
→
System.SystemException
→
ExternalException
→
COMException
Get C# in a Nutshell, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.