home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 19.ddi / SAMPLES / DIBVIEW / ERRORS.C_ / ERRORS.C
Encoding:
C/C++ Source or Header  |  1993-02-08  |  2.4 KB  |  63 lines

  1. /*************************************************************************
  2.  
  3.       File:  ERRORS.C
  4.  
  5.    Purpose:  Contains the error message box handler.
  6.  
  7.  Functions:  DIBError()
  8.  
  9.   Comments:  Should use a string table here...We're unnecessarily
  10.              eating up DS, and make it harder to localize for international
  11.              markets...  Maybe next time...
  12.  
  13.    History:   Date     Reason
  14.  
  15.              6/1/91    Created
  16.  
  17. *************************************************************************/
  18.  
  19.  
  20. #include "master.h"
  21.  
  22. static char *szErrors[] = {"Not a DIB file!",
  23.                            "Couldn't allocate memory!",
  24.                            "Error reading file!",
  25.                            "Error locking memory!",
  26.                            "Error opening file!",
  27.                            "Error creating palette!",
  28.                            "Error getting a DC!",
  29.                            "Error creating MDI Child!",
  30.                            "Error creating Device Dependent Bitmap",
  31.                            "StretchBlt() failed!",
  32.                            "StretchDIBits() failed!",
  33.                            "Paint requires both DDB and DIB!",
  34.                            "SetDIBitsToDevice() failed!",
  35.                            "Printer: StartDoc failed!",
  36.                            "Printing: GetModuleHandle() couldn't find GDI!",
  37.                            "Printer: SetAbortProc failed!",
  38.                            "Printer: StartPage failed!",
  39.                            "Printer: NEWFRAME failed!",
  40.                            "Printer: EndPage failed!",
  41.                            "Printer: EndDoc failed!",
  42.                            "Only one DIB can be animated at a time!",
  43.                            "No timers available for animation!",
  44.                            "Can't copy to clipboard -- no current DIB!",
  45.                            "Clipboard is busy -- operation aborted!",
  46.                            "Can't paste -- no DIBs or DDBs in clipboard!",
  47.                            "SetDIBits() failed!",
  48.                            "File Not Found!",
  49.                            "Error writing DIB file!"
  50.                           };
  51.  
  52. void DIBError (int ErrNo)
  53. {
  54.    if ((ErrNo < ERR_MIN) || (ErrNo >= ERR_MAX))
  55.    {
  56.       MessageBox (GetFocus (), "Undefined Error!", NULL, MB_OK | MB_ICONHAND);
  57.    }
  58.    else
  59.    {
  60.       MessageBox (GetFocus (), szErrors[ErrNo], NULL, MB_OK | MB_ICONHAND);
  61.    }
  62. }
  63.