次の方法で共有


COMException コンストラクター

定義

COMException クラスの新しいインスタンスを初期化します。

オーバーロード

名前 説明
COMException()

既定値を使用して、COMException クラスの新しいインスタンスを初期化します。

COMException(String)

指定したメッセージを使用して、 COMException クラスの新しいインスタンスを初期化します。

COMException(SerializationInfo, StreamingContext)
古い.

シリアル化データから COMException クラスの新しいインスタンスを初期化します。

COMException(String, Exception)

指定したエラー メッセージと、この例外の原因である内部例外への参照を使用して、 COMException クラスの新しいインスタンスを初期化します。

COMException(String, Int32)

指定したメッセージとエラー コードを使用して、 COMException クラスの新しいインスタンスを初期化します。

COMException()

ソース:
COMException.cs
ソース:
COMException.cs
ソース:
COMException.cs
ソース:
COMException.cs
ソース:
COMException.cs

既定値を使用して、COMException クラスの新しいインスタンスを初期化します。

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

注釈

COMException は、ExternalException から継承されます。 次の表に、このコンストラクターが Exception オブジェクトのプロパティを設定する方法を示します。

財産 価値
InnerException null
Message ローカライズされたエラー メッセージ文字列。

適用対象

COMException(String)

ソース:
COMException.cs
ソース:
COMException.cs
ソース:
COMException.cs
ソース:
COMException.cs
ソース:
COMException.cs

指定したメッセージを使用して、 COMException クラスの新しいインスタンスを初期化します。

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

パラメーター

message
String

例外の理由を示すメッセージ。

注釈

COMException は、ExternalException から継承されます。 次の表に、このコンストラクターが Exception オブジェクトのプロパティを設定する方法を示します。

財産 価値
InnerException null
Message message

適用対象

COMException(SerializationInfo, StreamingContext)

ソース:
COMException.cs
ソース:
COMException.cs
ソース:
COMException.cs
ソース:
COMException.cs
ソース:
COMException.cs

注意事項

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

シリアル化データから COMException クラスの新しいインスタンスを初期化します。

protected:
 COMException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected COMException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
protected COMException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Runtime.InteropServices.COMException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Runtime.InteropServices.COMException
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)

パラメーター

info
SerializationInfo

シリアル化されたオブジェクト データを保持する SerializationInfo オブジェクト。

context
StreamingContext

ソースまたは変換先に関するコンテキスト情報を提供する StreamingContext オブジェクト。

属性

例外

infonullです。

注釈

このコンストラクターは、ストリーム経由で送信される例外オブジェクトを再構成するために、逆シリアル化中に呼び出されます。 詳細については、「 XML および SOAP シリアル化」を参照してください。

COMException は、ExternalException から継承されます。

こちらもご覧ください

適用対象

COMException(String, Exception)

ソース:
COMException.cs
ソース:
COMException.cs
ソース:
COMException.cs
ソース:
COMException.cs
ソース:
COMException.cs

指定したエラー メッセージと、この例外の原因である内部例外への参照を使用して、 COMException クラスの新しいインスタンスを初期化します。

public:
 COMException(System::String ^ message, Exception ^ inner);
public COMException(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)

パラメーター

message
String

例外の理由を説明するエラー メッセージ。

inner
Exception

現在の例外の原因である例外。 inner パラメーターがnullされていない場合、内部例外を処理するcatch ブロックで現在の例外が発生します。

注釈

前の例外の直接の結果としてスローされる例外は、 InnerException プロパティに前の例外への参照を含める必要があります。 InnerException プロパティは、コンストラクターに渡されるのと同じ値を返します。または、null プロパティがコンストラクターに内部例外値を提供しない場合はInnerExceptionします。

次の表に、このコンストラクターが Exception オブジェクトのプロパティを設定する方法を示します。

財産 価値
InnerException 内部例外参照。
Message エラー メッセージ文字列。

こちらもご覧ください

適用対象

COMException(String, Int32)

ソース:
COMException.cs
ソース:
COMException.cs
ソース:
COMException.cs
ソース:
COMException.cs
ソース:
COMException.cs

指定したメッセージとエラー コードを使用して、 COMException クラスの新しいインスタンスを初期化します。

public:
 COMException(System::String ^ message, int errorCode);
public COMException(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)

パラメーター

message
String

例外が発生した理由を示すメッセージ。

errorCode
Int32

この例外に関連付けられているエラー コード (HRESULT) 値。

注釈

この COMException コンストラクターは、エラー コードを使用して基本メッセージを設定します。

COMException は、ExternalException から継承されます。 次の表に、このコンストラクターが Exception オブジェクトのプロパティを設定する方法を示します。

財産 価値
InnerException null
Message message

適用対象