home *** CD-ROM | disk | FTP | other *** search
- // printerr.h
-
- // this file defines a macro to display error messages based on
- // the "assert" macro in the standard C library. However, this
- // macro works in the Presentation Manager environment to display
- // a message box that looks like:
- //
- // +------------------------------+
- // | Error in line xx of file yy |
- // +------------------------------+
- // | PM error message from the |
- // | WinGetErrInfo API |
- // +------------------------------+
- //
- // the general form of the macro is:
- //
- // pmassert ( expression, hab );
- //
- // the macro only expands if the expression evaluates to 0
- //
- // you can use it to check the value returned by a PM API
- // for example:
- //
- // hwndFrame = WinQueryWindow (hwnd,QW_PARENT,FALSE);
- // pmassert(hwndFrame, hab); // display msg if hwndFrame==NULL
- //
-
- // to remove the code generated by this macro when you want to produce
- // a final version of your program with no error checking, define this
- // symbol before including this header:
- //
- // #define NDEBUG
-
- // Here is the function prototype for routine that displays message box.
- // This routine is defined in PRINTERR.C and is contained in PRINTERR.DLL
-
- VOID far pascal printerr ( PSZ szFilename, USHORT usLineNo, HAB hab );
-
- #ifndef NDEBUG
- #define pmassert(exp,hab) {if(!(exp)) printerr (__FILE__,__LINE__,hab);}
- #else
- #define pmassert(exp,hab)
- #endif
-