Name
Win32Exception
Synopsis
This class encapsulates an exception that is thrown to wrap the
failure of a Win32 native method call. The
NativeErrorCode
property can retrieve the
underlying Win32 error code that caused the exception to be thrown.
public class Win32Exception : System.Runtime.InteropServices.ExternalException { // Public Constructors public Win32Exception(); public Win32Exception(int error); public Win32Exception(int error, string message); // Protected Constructors protected Win32Exception(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context); // Public Instance Properties public int NativeErrorCode{get; } // Public Instance Methods public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context); // overrides Exception }
Hierarchy
System.Object
→ System.Exception(System.Runtime.Serialization.ISerializable) → System.SystemException → System.Runtime.InteropServices.ExternalException → Win32Exception
Subclasses
System.Net.Sockets.SocketException
Get .NET Windows Forms in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.