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

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

Parameters

dwErrorCode
Specifies the last error code for the current thread.

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 SMTP_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

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools11.h
Import Library: csmtpv11.lib

See Also

GetErrorString, GetLastError, ShowError