Jump to content

WinGetLastError: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
Line 3: Line 3:


=== Parameters ===
=== Parameters ===
; anchorHndl - [[OS2_API:DataType:HAB|HAB]] - input : The anchor block handle.
; anchorHndl - [[HAB]] - input : The anchor block handle.


=== Constants ===
=== Constants ===
Severity codes defined:
Severity codes defined:
* [[OS2 API:Constant:SEVERITY#SEVERITY_NOERROR|SEVERITY_NOERROR]]
* [[SEVERITY#SEVERITY_NOERROR|SEVERITY_NOERROR]]
* [[OS2 API:Constant:SEVERITY#SEVERITY_WARNING|SEVERITY_WARNING]]
* [[SEVERITY#SEVERITY_WARNING|SEVERITY_WARNING]]
* [[OS2 API:Constant:SEVERITY#SEVERITY_ERROR|SEVERITY_ERROR]]
* [[SEVERITY#SEVERITY_ERROR|SEVERITY_ERROR]]
* [[OS2 API:Constant:SEVERITY#SEVERITY_SEVERE|SEVERITY_SEVERE]]
* [[SEVERITY#SEVERITY_SEVERE|SEVERITY_SEVERE]]
* [[OS2 API:Constant:SEVERITY#SEVERITY_UNRECOVERABLE|SEVERITY_UNRECOVERABLE]]
* [[SEVERITY#SEVERITY_UNRECOVERABLE|SEVERITY_UNRECOVERABLE]]


=== Returns ===
=== Returns ===
Returns [[OS2_API:DataType:ERRORID|ERRORID]]:
Returns [[ERRORID]]:


The returned error code is a 32-bit value. The high order 16 bits is a severity code. The low order 16 bits is the error code.
The returned error code is a 32-bit value. The high order 16 bits is a severity code. The low order 16 bits is the error code.
Line 29: Line 29:


=== Example Code ===
=== Example Code ===
  [[OS2 API:DataType:HAB|HAB]]     anchorHndl;
  HAB    anchorHndl;
  [[OS2 API:DataType:ERRORID|ERRORID]] rc;
  ERRORID rc;
  ...
  ...
  rc = WinGetLastError(anchorHndl);
  rc = WinGetLastError(anchorHndl);
Line 36: Line 36:


=== Related Functions ===
=== Related Functions ===
[[OS2 API:WinFreeErrorInfo|WinFreeErrorInfo]] [[OS2 API:WinGetErrorInfo|WinGetErrorInfo]]
*[[WinFreeErrorInfo]]
*[[WinGetErrorInfo]]


=== Notes ===
=== Notes ===
Line 43: Line 44:
In multiple threaded applications where there are multiple anchor blocks, errors are stored in the anchor block created by the [[OS2_API:WinInitialize|WinInitialize]] function of the thread invoking a call. The last error for the process and thread on which this function call is made will be returned.
In multiple threaded applications where there are multiple anchor blocks, errors are stored in the anchor block created by the [[OS2_API:WinInitialize|WinInitialize]] function of the thread invoking a call. The last error for the process and thread on which this function call is made will be returned.


=== OS Version Introduced ===
[[Category:Win]]
 
 
 
[[OS2_API | Back to OS/2 API]]
 
 
[[Category:The OS/2 API Project]]

Revision as of 05:58, 5 December 2016

WinGetLastError

WinGetLastError(anchorHndl)
Get the error code which was set by the failure of a Presentation Manager function.

Parameters

anchorHndl - HAB - input
The anchor block handle.

Constants

Severity codes defined:

Returns

Returns ERRORID:

The returned error code is a 32-bit value. The high order 16 bits is a severity code. The low order 16 bits is the error code.

Module

Define (C/C++)

INCL_WINERRORS or INCL_PM or INCL_WIN

Export name/Ordinal

Calling conversion

Cdecl32

Example Code

HAB     anchorHndl;
ERRORID rc;
...
rc = WinGetLastError(anchorHndl);
...

Related Functions

Notes

This call retrieves the last error code and resets it to zero.

In multiple threaded applications where there are multiple anchor blocks, errors are stored in the anchor block created by the WinInitialize function of the thread invoking a call. The last error for the process and thread on which this function call is made will be returned.