Share via


CeGetLastError (RAPI)

This function returns the calling thread's last-error code value. CeGetLastError is a remote application interface (RAPI), which enables an application running on a desktop computer to make function calls on a Windows CE–based device.

DWORD CeGetLastError( void );

Return Values

The calling thread's last-error code value indicates success. Functions set this value by calling the SetLastError function. The Return Value section of each reference page notes the conditions under which the function sets the last-error code.

Remarks

You should call the CeGetLastError function immediately when a function's return value indicates that such a call will return useful data. That is because some functions call SetLastError(0) when they succeed, wiping out the error code set by the most recently failed function.

Most functions in the Win32 API that set the thread's last error code value set it when they fail; a few functions set it when they succeed. Function failure is typically indicated by a return value error code such as FALSE, NULL, 0xFFFFFFFF, or –1. Some functions call SetLastError under conditions of success; those cases are noted in each function's reference page.

Error codes are 32-bit values (bit 31 is the most significant bit). Bit 29 is reserved for application-defined error codes; no system error code has this bit set. If you are defining an error code for your application, set this bit to one. That indicates that the error code has been defined by an application, and ensures that your error code does not conflict with any error codes defined by the system.

To obtain an error string for system error codes, use the FormatMessage function. For a complete list of error codes, see Error Values or the SDK header file WINERROR.H.

When working with RAPI for Windows CE versions 1.0 and 1.01, use the PegGetLastError function.

For more information about using RAPI functions, see Invoking Functions from a Desktop Computer.

Requirements

Runs On Versions Defined in Include Link to
Windows CE OS 2.0 and later Rapi.h    

See Also

FormatMessage, SetLastError

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.