DosError disables or enables end-user notification of hard errors, program exceptions, or untrapped, numeric-processor exceptions.

In the following example, pop-up windows for hard errors and exceptions are disabled, then enabled again.

    #define INCL_DOSMISC   /* Error and exception values */
    #include <os2.h>


    /*************************************************/
    /* use pre-defined constants                     */
    /* FERR_DISABLEHARDERR   (0x00000000)            */
    /* FERR_ENABLEHARDERR    (0x00000001)            */
    /* FERR_ENABLEEXCEPTION  (0x00000000)            */
    /* FERR_DISABLEEXCEPTION (0x00000002)            */
    /* to create constants needed for DosError calls */
    /*************************************************/

    #define ENABLE_ERRORPOPUPS  FERR_ENABLEEXCEPTION | FERR_ENABLEHARDERR
    #define DISABLE_ERRORPOPUPS FERR_DISABLEEXCEPTION | FERR_DISABLEHARDERR

    APIRET ulrc;    /* Return code */

    ulrc = DosError(DISABLE_ERRORPOPUPS);   /* Action flag for disable */
    ulrc = DosError(ENABLE_ERRORPOPUPS);    /* Action flag for enable  */

The action to take is encoded as a binary flag. The following table shows the bit-values and their meanings.

Bit Values to Enable and Disable Hard-Error and Exception Pop-up Messages

ÚÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³Bit  ³Value³Meaning                                           ³
ÃÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³0    ³1    ³Enables hard-error pop-up messages.               ³
ÃÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³0    ³0    ³Disables hard-error pop-up messages.              ³
ÃÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³1    ³0    ³Enables exception pop-up messages.                ³
ÃÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³1    ³1    ³Disables exception pop-up messages.               ³
ÀÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
If DosError is not called, user notification for hard errors and exceptions is enabled by default.


[Back] [Next]