Class Win32
Helper class for Win32 errors
Inheritance
System.Object
Win32
Namespace: Dapplo.Windows.Common
Assembly: Dapplo.Windows.Common.dll
Syntax
public static class Win32 : object
Methods
| Improve this Doc View SourceGetHResult(Win32Error)
Get the error code from the Win32Error
Declaration
public static long GetHResult(Win32Error errorCode)
Parameters
Type | Name | Description |
---|---|---|
Win32Error | errorCode |
Returns
Type | Description |
---|---|
System.Int64 |
GetLastErrorCode()
Get the last Win32 error as an exception
Declaration
public static Win32Error GetLastErrorCode()
Returns
Type | Description |
---|---|
Win32Error |
GetMessage(Win32Error, UInt32)
Get the message for a Win32 error
Declaration
public static string GetMessage(Win32Error errorCode, uint languageId = null)
Parameters
Type | Name | Description |
---|---|---|
Win32Error | errorCode | Win32Error |
System.UInt32 | languageId | uint with language ID, see here |
Returns
Type | Description |
---|---|
System.String | string with the message |
SetLastError(UInt32)
Change the last error
Declaration
public static void SetLastError(uint dwErrCode)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | dwErrCode | error code to change to |