## Printer Device Driver

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

### PMAssert

Description

This function is similar to ASSERTT and ASSERTF, but it displays a message box if an error condition occurs. In addition to displaying a user-provided error message, the message box also displays the results of WinGetLastError (), the Presentation Manager error code. Use this function to assert OS/2 Presentation Manager APIs.

Format

    PMAssert(                 // Display a message box with pszString, and show WinGetLastError()

         BOOL  bDoit,         // Display message box only if this expression evaluates to TRUE

         HAB   habErr,        // Anchor block handle of thread checking for a PM error

         PSZ   pszString );   // Message to display on message box with PM error code

Parameters

bDoit (BOOL) Boolean value. If TRUE, then a message box is displayed.
habErr (HAB) Anchor block of program.
pszString (PSZ) Message string.

Returns

TRUE Evaluated to TRUE
FALSE Evaluated to FALSE

Example Code

    BOOL rc;

    rc = GpiDestroyPS( hps );

    PMAssert( rc == FALSE,

              hab,

              "GpiDestroyPS failed!" );