Jump to content

WinSetErrorInfo

From EDM2
Revision as of 03:00, 12 December 2019 by Martini (talk | contribs) (Created page with "WinSetErrorInfo posts an error message, which can be retrieved by an application that calls WinGetLastError. == Syntax == WinSetErrorInfo(idError, fsOptions, arg1...argN);...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

WinSetErrorInfo posts an error message, which can be retrieved by an application that calls WinGetLastError.

Syntax

WinSetErrorInfo(idError, fsOptions, arg1...argN);

Parameters

idError (ERRORID) - input
An ERRORID structure
An ERRORID structure with the following values:
lSeverity Valid values are:
SEVERITY_ERROR 
SEVERITY_NOERROR 
SEVERITY_SEVERE 
SEVERITY_WARNING 
SEVERITY_UNRECOVERABLE 
lErrorCode Error code. See Presentation Manager Error Codes for a list of defined values.
fsOptions (ULONG) - input
Option flags:


4000H Do not call DosBeep. 2000H Do not prompt the user. 0008H The next parameter is a base OS/2 error code. 0004H fsOptions must be set to 0004H to use the variable arguments arg1...argN. arg1 must contain the number of arguments that follow, not including arg1 itself. Note that fsOptions cannot equal 000CH; that is, DOSERROR and argcount are mutually exclusive.

arg1...argN (ULONG) - input
Variable number of optional arguments.
These parameters have no significance except when the presentation driver is reporting a base OS/2 error. The two examples that follow show how WinSetErrorInfo is used to post a presentation driver error and a base OS/2 error:


Example #1. To post a presentation driver error:

   WinSetErrorInfo (ERRORID (SEVERITY_ERROR, PMERR_INV_COORDINATE), NOBEEP);

Example #2. To post a base OS/2 error:

   WinSetErrorInfo (ERRORID (SEVERITY_WARNING, ErrorCode),
   (DOSERROR+NOBEEP+NOPROMPT), DosErrorCode);


There is no return value for this function.


Returns

There is no return value for this function.


Sample

#include <os2.h>

ERRORID    idError;      /*  An ERRORID structure */
ULONG      fsOptions;    /*  Option flags: */
ULONG      arg1...argN;  /*  Variable number of optional arguments. */

WinSetErrorInfo(idError, fsOptions, arg1...argN);

Remarks

The syntax of the call to WinSetErrorInfo allows a variable number of parameters. The minimum requirement is the appropriate ERRORID structure and a NULL value for fsOptions.

Note
Presentation drivers do not need to import this function through the module definition file.