## Printer Device Driver

[prev][next][parent][TOC]

### BaseAssert

Description

This function is similar to ASSERTT and ASSERTF, but it displays a message box if an error condition occurs. Use this function to assert return codes from those OS/2 APIs that use DOS Error-type return codes.

Format

    BaseAssert(                // Display message box if a base error (DOS) is passed in (ulError)

          ULONG  ulError,      // Value of base error as defined in BSEERR.H header file

          PSZ    pszString );  // String to print out with base error code

Parameters

ulError (ULONG) Return code from OS/2 BaseAPI, either NO_ERROR (0) or one of the ERROR_xxx DOS Error codes. If ulError is not equal to NO_ERROR, a message box is displayed.

pszString (PSZ) Message string.

Returns

TRUE Evaluated to TRUE
FALSE Evaluated to FALSE

Example Code

    APIRET apirc;

       apirc = DosAllocMem( pbuf, 1024h, PAG_READ | PAG_WRITE );

       BaseAssert( "DosAllocMem failed", apirc );