COMException 생성자

정의

COMException 클래스의 새 인스턴스를 초기화합니다.

오버로드

COMException()

기본값을 사용하여 COMException 클래스의 새 인스턴스를 초기화합니다.

COMException(String)

지정된 메시지를 사용하여 COMException 클래스의 새 인스턴스를 초기화합니다.

COMException(SerializationInfo, StreamingContext)
사용되지 않음.

serialization 데이터로부터 COMException 클래스의 새 인스턴스를 초기화합니다.

COMException(String, Exception)

지정된 오류 메시지와 해당 예외의 원인인 내부 예외에 대한 참조를 사용하여 COMException 클래스의 새 인스턴스를 초기화합니다.

COMException(String, Int32)

지정된 메시지와 오류 코드를 사용하여 COMException 클래스의 새 인스턴스를 초기화합니다.

COMException()

Source:
COMException.cs
Source:
COMException.cs
Source:
COMException.cs

기본값을 사용하여 COMException 클래스의 새 인스턴스를 초기화합니다.

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

설명

COMExceptionExternalException에서 상속됩니다. 다음 표에서는 이 생성자가 개체의 Exception 속성을 설정하는 방법을 보여줍니다.

속성
InnerException null.
Message 지역화된 오류 메시지 문자열입니다.

적용 대상

COMException(String)

Source:
COMException.cs
Source:
COMException.cs
Source:
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

예외에 대한 이유를 나타내는 메시지입니다.

설명

COMExceptionExternalException에서 상속됩니다. 다음 표에서는 이 생성자가 개체의 Exception 속성을 설정하는 방법을 보여줍니다.

속성
InnerException null
Message message

적용 대상

COMException(SerializationInfo, StreamingContext)

Source:
COMException.cs
Source:
COMException.cs
Source:
COMException.cs

주의

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

serialization 데이터로부터 COMException 클래스의 새 인스턴스를 초기화합니다.

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}")]
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
[<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
Protected Sub New (info As SerializationInfo, context As StreamingContext)

매개 변수

info
SerializationInfo

serialize된 개체 데이터를 유지하는 SerializationInfo 개체입니다.

context
StreamingContext

소스 또는 대상에 대한 컨텍스트 정보를 제공하는 StreamingContext 개체입니다.

특성

예외

infonull입니다.

설명

이 생성자는 스트림을 통해 전송되는 예외 개체를 다시 구성하기 위해 역직렬화 중에 호출됩니다. 자세한 내용은 XML 및 SOAP Serialization합니다.

COMExceptionExternalException에서 상속됩니다.

추가 정보

적용 대상

COMException(String, Exception)

Source:
COMException.cs
Source:
COMException.cs
Source:
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 블록에서 발생합니다.

설명

이전 예외의 직접적인 결과로 throw되는 예외의 InnerException 속성에는 이전 예외에 대한 참조가 들어 있어야 합니다. InnerException 속성은 생성자로 전달되는 값과 같은 값을 반환하거나, InnerException 속성이 생성자에 내부 예외 값을 제공하지 않는 경우 null을 반환합니다.

다음 표에서는 이 생성자가 개체의 Exception 속성을 설정하는 방법을 보여줍니다.

속성
InnerException 내부 예외 참조
Message 오류 메시지 문자열입니다.

추가 정보

적용 대상

COMException(String, Int32)

Source:
COMException.cs
Source:
COMException.cs
Source:
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 생성자는 오류 코드로 기본 메시지를 설정합니다.

COMExceptionExternalException에서 상속됩니다. 다음 표에서는 이 생성자가 개체의 Exception 속성을 설정하는 방법을 보여줍니다.

속성
InnerException null
Message message

적용 대상