Skip to content

Latest commit

 

History

History
43 lines (28 loc) · 1.04 KB

SetLastError.md

File metadata and controls

43 lines (28 loc) · 1.04 KB

Home

Function name : SetLastError

Group: Error Handling - Library: kernel32


Sets the last-error code for the calling thread. This function is intended primarily for dynamic-link libraries (DLL). Calling this function after an error occurs lets the DLL emulate the behavior of the Win32 API.

If you are defining an error code for your application, be sure that your error code does not conflict with any system-defined error codes.


Code examples:

Setting the last-error code for the FoxPro

Declaration:

VOID SetLastError(
  DWORD dwErrCode   // per-thread error code
);  

FoxPro declaration:

DECLARE SetLastError IN kernel32 INTEGER dwErrCode  

Parameters:

dwErrCode [in] Specifies the last-error code for the thread


Return value:

This function does not return a value