相关文章推荐
伤情的创口贴  ·  解决: ...·  7 月前    · 
鼻子大的书包  ·  MRTG FOR WINDOWS ...·  1 年前    · 
难过的牛排  ·  Java String indexOf() ...·  1 年前    · 

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft Edge More info about Internet Explorer and Microsoft Edge
public ref class SEHException : Exception
public ref class SEHException : System::Runtime::InteropServices::ExternalException
public class SEHException : Exception
public class SEHException : System.Runtime.InteropServices.ExternalException
[System.Serializable]
public class SEHException : System.Runtime.InteropServices.ExternalException
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public class SEHException : System.Runtime.InteropServices.ExternalException
type SEHException = class
    inherit Exception
type SEHException = class
    inherit ExternalException
[<System.Serializable>]
type SEHException = class
    inherit ExternalException
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type SEHException = class
    inherit ExternalException
Public Class SEHException
Inherits Exception
Public Class SEHException
Inherits ExternalException
Inheritance
SEHException

Remarks

The SEHException class handles SEH errors that are thrown from unmanaged code, but that have not been mapped to another .NET Framework exception. The SEHException class also corresponds to the HRESULT E_FAIL (0x80004005).

The .NET Framework often encounters unmanaged SEH exceptions that are automatically mapped to managed equivalents. There are two common unmanaged SEH exceptions:

  • STATUS_NO_MEMORY exceptions are automatically mapped to the OutOfMemoryException class.

  • STATUS_ACCESS_VIOLATION exceptions are automatically mapped as follows:

  • If legacyNullReferencePolicy is applied, all access violations are mapped to the NullReferenceException class.

  • If the address at which the read/write was attempted is not in JIT-compiled code, the exception is mapped to the AccessViolationException class.

  • If the address at which the read/write was attempted is in JIT-compiled code, but it is not in the OS Null partition area, the exception is mapped to the AccessViolationException class.

  • If there is no legacyNullReferencePolicy , and the address at which the read/write was attempted is in JIT-compiled code and in the OS Null partition area, the exception is mapped to the NullReferenceException class.

    Any SEH exception that is not automatically mapped to a specific exception is mapped to the SEHException class by default.

    Note that the SEHException class does not cause unmanaged C++ exception destructors to be called. To ensure that unmanaged C++ exception destructors are called, use the following syntax in the catch block.

    Catch
         ' Handle catch here.
    End Try
    
    catch
         // Handle catch here.
    
    catch(…)
         // Handle catch here.
    		

    Gets a collection of key/value pairs that provide additional user-defined information about the exception.

    (Inherited from Exception)

    When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.

    (Inherited from Exception) Obsolete.

    When overridden in a derived class, sets the SerializationInfo with information about the exception.

    (Inherited from Exception) Obsolete.

    Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception.

    (Inherited from Exception) Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see: https://aka.ms/ContentUserFeedback.

    Submit and view feedback for

    This product
  •