﻿<?xml version="1.0" encoding="utf-8"?><Type Name="COMException" FullName="System.Runtime.InteropServices.COMException"><TypeSignature Maintainer="auto" Language="C#" Value="public class COMException : System.Runtime.InteropServices.ExternalException" /><TypeSignature Language="ILAsm" Value=".class public auto ansi serializable beforefieldinit COMException extends System.Runtime.InteropServices.ExternalException" /><AssemblyInfo><AssemblyName>mscorlib</AssemblyName><AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the &lt;link location="node:gtk-sharp/programming/threads"&gt;Gtk# Thread Programming&lt;/link&gt; for details.</ThreadSafetyStatement><Base><BaseTypeName>System.Runtime.InteropServices.ExternalException</BaseTypeName></Base><Interfaces></Interfaces><Attributes><Attribute><AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName></Attribute></Attributes><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>The common language runtime transforms well-known HRESULTs to.NET exceptions, enabling COM objects to return meaningful error information to managed clients. The HRESULT to exception mapping also works in the other direction by returning specific HRESULTs to unmanaged clients. For mapping details, see <format type="text/html"><a href="610B364B-2761-429D-9C4A-AFBC3E66F1B9">[&lt;topic://cpconhresultsexceptions&gt;]</a></format>.</para><para>When the runtime encounters an unfamiliar HRESULT (an HRESULT that lacks a specific, corresponding exception), it throws an instance of the <see cref="T:System.Runtime.InteropServices.COMException" /> class. This all-purpose exception exposes the same members as any exception, and includes a public ErrorCode property that contains the HRESULT returned by the callee. If an error message is available to the runtime (obtained from the IErrorInfo interface or the Err object in Visual Basic, or in some cases from the operating system), the message is returned to the caller. However, if the COM component developer fails to include an error message, the runtime returns the eight-digit HRESULT in place of a message string. Having an HRESULT allows the caller to determine the cause of the generic exception.</para><para>Although you can use the <see cref="T:System.Runtime.InteropServices.COMException" /> class to return specific HRESULTs to unmanaged clients, throwing a specific.NET exception is better than using a generic exception. Consider that managed clients as well as unmanaged clients can use your.NET object, and throwing an HRESULT to a managed caller is less comprehendible than throwing an exception.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>The exception that is thrown when an unrecognized HRESULT is returned from a COM method call.</para></summary></Docs><Members><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public COMException ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue /><Parameters /><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para><see cref="T:System.Runtime.InteropServices.COMException" /> inherits from <see cref="T:System.Runtime.InteropServices.ExternalException" />. The following table shows how this constructor sets the properties of the <see cref="T:System.Exception" /> object.</para><list type="table"><listheader><item><term><para>Property </para></term><description><para>Value </para></description></item></listheader><item><term><para><see cref="P:System.Exception.InnerException" /></para></term><description><para>null. </para></description></item><item><term><para><see cref="P:System.Exception.Message" /></para></term><description><para>A localized error message string. </para></description></item></list></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.COMException" /> class with default values.</para></summary></Docs></Member><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public COMException (string message);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message) cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue /><Parameters><Parameter Name="message" Type="System.String" /></Parameters><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para><see cref="T:System.Runtime.InteropServices.COMException" /> inherits from <see cref="T:System.Runtime.InteropServices.ExternalException" />. The following table shows how this constructor sets the properties of the <see cref="T:System.Exception" /> object.</para><list type="table"><listheader><item><term><para>Property </para></term><description><para>Value </para></description></item></listheader><item><term><para><see cref="P:System.Exception.InnerException" /></para></term><description><para>null </para></description></item><item><term><para><see cref="P:System.Exception.Message" /></para></term><description><para><paramref name="message" /></para></description></item></list></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.COMException" /> class with a specified message.</para></summary><param name="message"><attribution license="cc4" from="Microsoft" modified="false" />The message that indicates the reason for the exception. </param></Docs></Member><Member MemberName=".ctor"><MemberSignature Language="C#" Value="protected COMException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" /><MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(class System.Runtime.Serialization.SerializationInfo info, valuetype System.Runtime.Serialization.StreamingContext context) cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue /><Parameters><Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" /><Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" /></Parameters><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>This constructor is called during deserialization to reconstitute the exception object transmitted over a stream. For more information, see <format type="text/html"><a href="832AC524-21BC-419A-A27B-CA8BFC45840F">[&lt;topic://cpconSerialization&gt;]</a></format>.</para><para><see cref="T:System.Runtime.InteropServices.COMException" /> inherits from <see cref="T:System.Runtime.InteropServices.ExternalException" />.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.COMException" /> class from serialization data.</para></summary><param name="info"><attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object that holds the serialized object data. </param><param name="context"><attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Runtime.Serialization.StreamingContext" /> object that supplies the contextual information about the source or destination. </param></Docs></Member><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public COMException (string message, Exception inner);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message, class System.Exception inner) cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue /><Parameters><Parameter Name="message" Type="System.String" /><Parameter Name="inner" Type="System.Exception" /></Parameters><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the <see cref="P:System.Exception.InnerException" /> property. The <see cref="P:System.Exception.InnerException" /> property returns the same value that is passed into the constructor, or null if the <see cref="P:System.Exception.InnerException" /> property does not supply the inner exception value to the constructor.</para><para>The following table shows how this constructor sets the properties of the <see cref="T:System.Exception" /> object.</para><list type="table"><listheader><item><term><para>Property </para></term><description><para>Value </para></description></item></listheader><item><term><para><see cref="P:System.Exception.InnerException" /></para></term><description><para>The inner exception reference. </para></description></item><item><term><para><see cref="P:System.Exception.Message" /></para></term><description><para>The error message string. </para></description></item></list></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.COMException" /> class with a specified error message and a reference to the inner exception that is the cause of this exception.</para></summary><param name="message"><attribution license="cc4" from="Microsoft" modified="false" />The error message that explains the reason for the exception. </param><param name="inner"><attribution license="cc4" from="Microsoft" modified="false" />The exception that is the cause of the current exception. If the <paramref name="inner" /> parameter is not null, the current exception is raised in a catch block that handles the inner exception. </param></Docs></Member><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public COMException (string message, int errorCode);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message, int32 errorCode) cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue /><Parameters><Parameter Name="message" Type="System.String" /><Parameter Name="errorCode" Type="System.Int32" /></Parameters><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>This <see cref="T:System.Runtime.InteropServices.COMException" /> constructor sets the base message with the error code.</para><para><see cref="T:System.Runtime.InteropServices.COMException" /> inherits from <see cref="T:System.Runtime.InteropServices.ExternalException" />. The following table shows how this constructor sets the properties of the <see cref="T:System.Exception" /> object.</para><list type="table"><listheader><item><term><para>Property </para></term><description><para>Value </para></description></item></listheader><item><term><para><see cref="P:System.Exception.InnerException" /></para></term><description><para>null </para></description></item><item><term><para><see cref="P:System.Exception.Message" /></para></term><description><para><paramref name="message" /></para></description></item></list></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.COMException" /> class with a specified message and error code.</para></summary><param name="message"><attribution license="cc4" from="Microsoft" modified="false" />The message that indicates the reason the exception occurred. </param><param name="errorCode"><attribution license="cc4" from="Microsoft" modified="false" />The error code (HRESULT) value associated with this exception. </param></Docs></Member><Member MemberName="ToString"><MemberSignature Language="C#" Value="public override string ToString ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance string ToString() cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.String</ReturnType></ReturnValue><Parameters /><Docs><remarks>To be added.</remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Converts the contents of the exception to a string.</para></summary><returns><attribution license="cc4" from="Microsoft" modified="false" /><para>A string containing the <see cref="P:System.Exception.HResult" />, <see cref="P:System.Exception.Message" />, <see cref="P:System.Exception.InnerException" />, and <see cref="P:System.Exception.StackTrace" /> properties of the exception.</para></returns></Docs></Member></Members></Type>