COMException Constructores
Definición
Inicializa una nueva instancia de la clase COMException.Initializes a new instance of the COMException class.
Sobrecargas
COMException() |
Inicializa una nueva instancia de la clase COMException con valores predeterminados.Initializes a new instance of the COMException class with default values. |
COMException(String) |
Inicializa una nueva instancia de la clase COMException con el mensaje especificado.Initializes a new instance of the COMException class with a specified message. |
COMException(SerializationInfo, StreamingContext) |
Inicializa una nueva instancia de la clase COMException a partir de los datos de serialización.Initializes a new instance of the COMException class from serialization data. |
COMException(String, Exception) |
Inicializa una nueva instancia de la clase COMException con el mensaje de error especificado y una referencia a la excepción interna que representa la causa de esta excepción.Initializes a new instance of the COMException class with a specified error message and a reference to the inner exception that is the cause of this exception. |
COMException(String, Int32) |
Inicializa una nueva instancia de la clase COMException con un mensaje y un código de error especificados.Initializes a new instance of the COMException class with a specified message and error code. |
COMException()
Inicializa una nueva instancia de la clase COMException con valores predeterminados.Initializes a new instance of the COMException class with default values.
public:
COMException();
public COMException ();
Public Sub New ()
Comentarios
COMException hereda de ExternalException.COMException inherits from ExternalException. En la tabla siguiente se muestra cómo este constructor establece las propiedades del Exception objeto.The following table shows how this constructor sets the properties of the Exception object.
Propiedad.Property | ValorValue |
---|---|
InnerException | null .null . |
Message | Una cadena de mensaje de error localizada.A localized error message string. |
Se aplica a
COMException(String)
Inicializa una nueva instancia de la clase COMException con el mensaje especificado.Initializes a new instance of the COMException class with a specified message.
public:
COMException(System::String ^ message);
public COMException (string message);
new System.Runtime.InteropServices.COMException : string -> System.Runtime.InteropServices.COMException
Public Sub New (message As String)
Parámetros
- message
- String
Mensaje que indica el motivo de la excepción.The message that indicates the reason for the exception.
Comentarios
COMException hereda de ExternalException.COMException inherits from ExternalException. En la tabla siguiente se muestra cómo este constructor establece las propiedades del Exception objeto.The following table shows how this constructor sets the properties of the Exception object.
Propiedad.Property | ValorValue |
---|---|
InnerException | null |
Message | message |
Se aplica a
COMException(SerializationInfo, StreamingContext)
Inicializa una nueva instancia de la clase COMException a partir de los datos de serialización.Initializes a new instance of the COMException class from serialization data.
protected:
COMException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected COMException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Runtime.InteropServices.COMException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Runtime.InteropServices.COMException
Protected Sub New (info As SerializationInfo, context As StreamingContext)
Parámetros
- info
- SerializationInfo
Objeto SerializationInfo que contiene los datos del objeto serializados.The SerializationInfo object that holds the serialized object data.
- context
- StreamingContext
Objeto StreamingContext que proporciona la información contextual sobre el origen o el destino.The StreamingContext object that supplies the contextual information about the source or destination.
Excepciones
info
es null
.info
is null
.
Comentarios
Se llama a este constructor durante la deserialización para reconstituir el objeto de excepción transmitido en un flujo.This constructor is called during deserialization to reconstitute the exception object transmitted over a stream. Para obtener más información, vea serialización XML y SOAP.For more information, see XML and SOAP Serialization.
COMException hereda de ExternalException.COMException inherits from ExternalException.
Consulte también
Se aplica a
COMException(String, Exception)
Inicializa una nueva instancia de la clase COMException con el mensaje de error especificado y una referencia a la excepción interna que representa la causa de esta excepción.Initializes a new instance of the COMException class with a specified error message and a reference to the inner exception that is the cause of this exception.
public:
COMException(System::String ^ message, Exception ^ inner);
public COMException (string message, Exception inner);
new System.Runtime.InteropServices.COMException : string * Exception -> System.Runtime.InteropServices.COMException
Public Sub New (message As String, inner As Exception)
Parámetros
- message
- String
Mensaje de error que explica el motivo de la excepción.The error message that explains the reason for the exception.
- inner
- Exception
Excepción que es la causa de la excepción actual.The exception that is the cause of the current exception. Si el parámetro inner
no es null
, la excepción actual se produce en un bloque catch
que controla la excepción interna.If the inner
parameter is not null
, the current exception is raised in a catch
block that handles the inner exception.
Comentarios
Una excepción que se produce como consecuencia directa de una excepción anterior debe incluir una referencia a esta última en la propiedad InnerException.An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property. La propiedad InnerException devuelve el mismo valor que se haya pasado al constructor, o bien null
en caso de que la propiedad InnerException no le haya proporcionado al constructor el valor de la excepción interna.The InnerException property returns the same value that is passed into the constructor, or null
if the InnerException property does not supply the inner exception value to the constructor.
En la tabla siguiente se muestra cómo este constructor establece las propiedades del Exception objeto.The following table shows how this constructor sets the properties of the Exception object.
Propiedad.Property | ValorValue |
---|---|
InnerException | Referencia a la excepción interna.The inner exception reference. |
Message | Cadena con el mensaje de error.The error message string. |
Consulte también
Se aplica a
COMException(String, Int32)
Inicializa una nueva instancia de la clase COMException con un mensaje y un código de error especificados.Initializes a new instance of the COMException class with a specified message and error code.
public:
COMException(System::String ^ message, int errorCode);
public COMException (string message, int errorCode);
new System.Runtime.InteropServices.COMException : string * int -> System.Runtime.InteropServices.COMException
Public Sub New (message As String, errorCode As Integer)
Parámetros
- message
- String
El mensaje que indica la causa de que se haya producido la excepción.The message that indicates the reason the exception occurred.
- errorCode
- Int32
Valor de código de error (HRESULT) asociado a esta excepción.The error code (HRESULT) value associated with this exception.
Comentarios
Este COMException constructor establece el mensaje base con el código de error.This COMException constructor sets the base message with the error code.
COMException hereda de ExternalException.COMException inherits from ExternalException. En la tabla siguiente se muestra cómo este constructor establece las propiedades del Exception objeto.The following table shows how this constructor sets the properties of the Exception object.
Propiedad.Property | ValorValue |
---|---|
InnerException | null |
Message | message |