GetLastError - Get the calling thread's last error code value

Top  Previous  Next

Syntax

<nLastError> := GetLastError()

Parameters

none

Return value

The current thread's last error code that was taken down after the last call to DllExecuteCallEx or set with SetLastError.

Description

GetLastError is a substitute function for GetLastError provided by kernel32.dll for applications using Cockpit. Cockpit adapter functions rely on O/S functions for parameter adaption. These extra calls can falsify the current thread's 'real' last error code produced by the adapted function call. DllExecuteCallEx takes down the last error code for retrieval with GetLastError. GetLastError returns this last error value taken down by DllExecuteCallEx. This value can also be set with SetLastError.

Classification

Core

Category

Error handling

Quick Info

Library: cckptcor.lib / cckptcor.dll

See also

SetLastError, DllExecuteCallEx

Example

 

#INCLUDE "CockpitCoreLibs.ch"

 

FUNCTION Main

 

* Set the last error code

SetLastError(250)

 

* Show it

? GetLastError()

 

RETURN NIL