Result codes for GetLastError()

Just for reference purposes, all System Error Codes are listed on MSDN:

To actually translate numeric error codes to user-readable error codes, use the FormatMessage function.

In .NET, use the following code snippet as a replacement for the FormatMessage function:

var errorMessage =
    new Win32Exception(Marshal.GetLastWin32Error()).Message;

(Tip via pinvoke.net)

2 thoughts on “Result codes for GetLastError()

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>