CDnsClient::SetLastError Method  
 
VOID SetLastError(
  DWORD dwErrorCode  
);

The SetLastError method sets the error code for the current thread. This method is typically used to clear the last error by passing a value of zero as the parameter.

Parameters

dwErrorCode
Specifies the error code for the current thread. A value of zero clears the last error code.

Return Value

None.

Remarks

Error codes are unsigned 32-bit values which are private to each calling thread. Most methods will set the last error code value when they fail; a few methods set it when they succeed. Function failure is typically indicated by a return value such as FALSE, NULL, INVALID_CLIENT or DNS_ERROR. Those methods which call SetLastError when they succeed are noted on the method reference page.

Applications can retrieve the value saved by this method by using the GetLastError method. The use of GetLastError is optional; an application can call the method to determine the specific reason for a method failure.

Requirements

Client: Requires Windows 7, Windows Vista or Windows XP.
Server: Requires Windows Server 2008 or Windows Server 2003.
Header: Include cstools7.h.
Library: Use csdnsav7.lib.
Unicode: Implemented as Unicode and ANSI versions.

See Also

GetErrorString, GetLastError, ShowError