InvalidOleVariantTypeException 构造函数

定义

初始化 InvalidOleVariantTypeException 类的新实例。Initializes a new instance of the InvalidOleVariantTypeException class.

重载

InvalidOleVariantTypeException()

使用默认值初始化 InvalidOleVariantTypeException 类的新实例。Initializes a new instance of the InvalidOleVariantTypeException class with default values.

InvalidOleVariantTypeException(String)

用指定的消息初始化 InvalidOleVariantTypeException 类的新实例。Initializes a new instance of the InvalidOleVariantTypeException class with a specified message.

InvalidOleVariantTypeException(SerializationInfo, StreamingContext)

从序列化数据初始化 InvalidOleVariantTypeException 类的新实例。Initializes a new instance of the InvalidOleVariantTypeException class from serialization data.

InvalidOleVariantTypeException(String, Exception)

使用指定的错误消息和对作为此异常原因的内部异常的引用来初始化 InvalidOleVariantTypeException 类的新实例。Initializes a new instance of the InvalidOleVariantTypeException class with a specified error message and a reference to the inner exception that is the cause of this exception.

InvalidOleVariantTypeException()

使用默认值初始化 InvalidOleVariantTypeException 类的新实例。Initializes a new instance of the InvalidOleVariantTypeException class with default values.

public:
 InvalidOleVariantTypeException();
public InvalidOleVariantTypeException ();
Public Sub New ()

注解

InvalidOleVariantTypeException 继承自 SystemExceptionInvalidOleVariantTypeException inherits from SystemException. 此构造函数将设置 Exception 对象的属性,如下表所示。This constructor sets the properties of the Exception object as shown in the following table.

属性Property Value
InnerException nullnull.
Message 已本地化的错误消息字符串。A localized error message string.

InvalidOleVariantTypeException(String)

用指定的消息初始化 InvalidOleVariantTypeException 类的新实例。Initializes a new instance of the InvalidOleVariantTypeException class with a specified message.

public:
 InvalidOleVariantTypeException(System::String ^ message);
public InvalidOleVariantTypeException (string message);
new System.Runtime.InteropServices.InvalidOleVariantTypeException : string -> System.Runtime.InteropServices.InvalidOleVariantTypeException
Public Sub New (message As String)

参数

message
String

指示异常原因的消息。The message that indicates the reason for the exception.

注解

InvalidOleVariantTypeException 继承自 SystemExceptionInvalidOleVariantTypeException inherits from SystemException. 此构造函数将设置 Exception 对象的属性,如下表所示。This constructor sets the properties of the Exception object as shown in the following table.

属性Property Value
InnerException nullnull.
Message message

InvalidOleVariantTypeException(SerializationInfo, StreamingContext)

从序列化数据初始化 InvalidOleVariantTypeException 类的新实例。Initializes a new instance of the InvalidOleVariantTypeException class from serialization data.

protected:
 InvalidOleVariantTypeException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected InvalidOleVariantTypeException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Runtime.InteropServices.InvalidOleVariantTypeException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Runtime.InteropServices.InvalidOleVariantTypeException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

参数

info
SerializationInfo

包含序列化对象数据的对象。The object that holds the serialized object data.

context
StreamingContext

与源或目标有关的上下文信息。The contextual information about the source or destination.

异常

infonullinfo is null.

注解

在反序列化期间调用此构造函数以重新构造在流上传输的异常对象。This constructor is called during deserialization to reconstitute the exception object transmitted over a stream. 有关详细信息,请参阅 System.Runtime.SerializationFor more information, see System.Runtime.Serialization.

InvalidOleVariantTypeException 继承自 SystemExceptionInvalidOleVariantTypeException inherits from SystemException.

InvalidOleVariantTypeException(String, Exception)

使用指定的错误消息和对作为此异常原因的内部异常的引用来初始化 InvalidOleVariantTypeException 类的新实例。Initializes a new instance of the InvalidOleVariantTypeException class with a specified error message and a reference to the inner exception that is the cause of this exception.

public:
 InvalidOleVariantTypeException(System::String ^ message, Exception ^ inner);
public InvalidOleVariantTypeException (string message, Exception inner);
new System.Runtime.InteropServices.InvalidOleVariantTypeException : string * Exception -> System.Runtime.InteropServices.InvalidOleVariantTypeException
Public Sub New (message As String, inner As Exception)

参数

message
String

解释异常原因的错误消息。The error message that explains the reason for the exception.

inner
Exception

引起当前异常的异常。The exception that is the cause of the current exception. 如果 inner 参数不为 null,则当前异常将在处理内部异常的 catch 块中引发。If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception.

注解

因前一个异常而直接引发的异常应在 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. InnerException 属性返回的值与传递到构造函数中的值相同;或者,如果 null 属性没有向构造函数提供内部异常值,则为 InnerExceptionThe 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.

下表显示 InvalidOleVariantTypeException 的实例的初始属性值。The following table shows the initial property values for an instance of InvalidOleVariantTypeException.

属性Property Value
InnerException 内部异常引用。The inner exception reference.
Message 错误消息字符串。The error message string.

另请参阅

适用于