SetLastError (kernel32)
Last changed: -124.148.167.58

.
Summary

C# Signature:

/// <summary>
/// Sets the last-error code for the calling thread.
/// </summary>
/// <param name="dwErrorCode">The last-error code for the thread.</param>
[DllImport("kernel32.dll", SetLastError = true)]
static extern void SetLastError(uint dwErrorCode);

VB.NET Signature:

Declare Function SetLastError Lib "kernel32.dll" (ByVal dwErrCode As Integer) As Integer

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

Call SetLastError(0) at the beginning of your function if you'll use GetLastError.

Sample Code:

Please add some!

Alternative Managed API:

Do you know one? Please contribute it!

Documentation