WinGetLastError: Difference between revisions
Appearance
created |
mNo edit summary |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
Get the error code which was set by the failure of a Presentation Manager function. | Get the error code which was set by the failure of a Presentation Manager function. | ||
==Syntax== | |||
WinGetLastError(anchorHndl) | |||
=== Parameters === | === Parameters === | ||
; anchorHndl - [[ | ;anchorHndl - [[HAB]] - input : The anchor block handle. | ||
The anchor block handle. | |||
=== Constants === | === Constants === | ||
Severity codes defined: | Severity codes defined: | ||
* [[ | *[[SEVERITY#SEVERITY_NOERROR|SEVERITY_NOERROR]] | ||
* [[ | *[[SEVERITY#SEVERITY_WARNING|SEVERITY_WARNING]] | ||
* [[ | *[[SEVERITY#SEVERITY_ERROR|SEVERITY_ERROR]] | ||
* [[ | *[[SEVERITY#SEVERITY_SEVERE|SEVERITY_SEVERE]] | ||
* [[ | *[[SEVERITY#SEVERITY_UNRECOVERABLE|SEVERITY_UNRECOVERABLE]] | ||
=== Returns === | === Returns === | ||
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. | 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. | ||
=== Define (C/C++) === | === Define (C/C++) === | ||
INCL_WINERRORS or INCL_PM or INCL_WIN | INCL_WINERRORS or INCL_PM or INCL_WIN | ||
=== Calling Convention === | |||
=== Calling | |||
[[Cdecl32]] | [[Cdecl32]] | ||
=== Example Code === | === Example Code === | ||
HAB anchorHndl; | |||
ERRORID rc; | |||
... | ... | ||
rc = WinGetLastError(anchorHndl); | rc = WinGetLastError(anchorHndl); | ||
Line 38: | Line 33: | ||
=== Related Functions === | === Related Functions === | ||
[[ | *[[WinFreeErrorInfo]] | ||
*[[WinGetErrorInfo]] | |||
=== Notes === | === Notes === | ||
This call retrieves the last error code and resets it to zero. | 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 [[ | 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. | ||
[[Category:Win]] |
Latest revision as of 14:37, 7 September 2017
Get the error code which was set by the failure of a Presentation Manager function.
Syntax
WinGetLastError(anchorHndl)
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.
Define (C/C++)
INCL_WINERRORS or INCL_PM or INCL_WIN
Calling Convention
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.