home *** CD-ROM | disk | FTP | other *** search
/ The Best of Select: Games 3 / cd.iso / os2 / rollball / error.h < prev    next >
Text File  |  1992-07-12  |  4KB  |  62 lines

  1. /***********************************************************************\
  2.  *                               Error.h                               *
  3.  *                 Copyright (C) by Stangl Roman, 1992                 *
  4.  * This Code may be freely distributed, provided the Copyright isn't   *
  5.  * removed.                                                            *
  6.  *                                                                     *
  7.  * Requires: Error.c    The routing General_Error                      *
  8.  *           Error.h    The include-file that defines the macros       *
  9.  *                      GEN_ERR, DOS_ERR                               *
  10.  *                                                                     *
  11.  * Error is a general errorhandler for OS/2 2.0 PM programmer to easy  *
  12.  * program development. The routine General_Error displays:            *
  13.  *      ErrModule       The module containing the error                *
  14.  *      ErrLine         The sourcecode line, that contains the error   *
  15.  *      Error           The error returned by an OS/2 API              *
  16.  * The routine requires the following parameters passed:               *
  17.  *      HAB hab         The anchor block handle                        *
  18.  *      HWND hwndFrame  The windowhandle of the frame window           *
  19.  *      HWND hwndClient The windowhandle of the client window          *
  20.  *      PSZ ErrModule   The pointer to the name of the module __FILE__ *
  21.  *      LONG ErrLine    The pointer to the sourcecodeline __LINE__     *
  22.  *                                                                     *
  23.  * The routine Dos_Error displays:                                     *
  24.  *      ErrModule       The module containing the error                *
  25.  *      ErrLine         The sourcecode line, that contains the error   *
  26.  *      Error           The error returned by an OS/2 API              *
  27.  * The routine requires the following parameters passed:               *
  28.  *      ReturnCode      The returncode of an os/2 API                  *
  29.  *      HWND hwndFrame  The windowhandle of the frame window           *
  30.  *      HWND hwndClient The windowhandle of the client window          *
  31.  *      PSZ ErrModule   The pointer to the name of the module __FILE__ *
  32.  *      LONG ErrLine    The pointer to the sourcecodeline __LINE__     *
  33.  *                                                                     *
  34.  * The routine User_Error displays:                                    *
  35.  *      ErrModule       The module containing the error                *
  36.  *      ErrLine         The sourcecode line, that contains the error   *
  37.  *      Error           The error indicated by the user                *
  38.  * The routine requires the following parameters passed:               *
  39.  *      PSZ ErrorCode   The errorcode of the user                      *
  40.  *      HWND hwndFrame  The windowhandle of the frame window           *
  41.  *      HWND hwndClient The windowhandle of the client window          *
  42.  *      PSZ ErrModule   The pointer to the name of the module __FILE__ *
  43.  *      LONG ErrLine    The pointer to the sourcecodeline __LINE__     *
  44. \***********************************************************************/
  45.  
  46. #define         INCL_WIN
  47. #define         INCL_DOSMISC
  48.  
  49. #include        <os2.h>
  50. #include        <stdio.h>
  51. #include        <string.h>
  52.  
  53. #define         GEN_ERR_MSGBOXID 61234  /* This number should'nt occur in any other program */
  54. #define         GEN_ERR(x,y,z) General_Error(x,y,z,__FILE__,__LINE__)
  55. #define         DOS_ERR(x,y,z) Dos_Error(x,y,z,__FILE__,__LINE__)
  56. #define         USR_ERR(x) User_Error(x,hwndFrame,hwndClient,__FILE__,__LINE__)
  57.  
  58. extern void General_Error(HAB hab,HWND hwndFrame,HWND hwndClient,PSZ ErrModule,LONG ErrLine);
  59. extern void Dos_Error(ULONG Error,HWND hwndFrame,HWND hwndClient,PSZ ErrModule,LONG ErrLine);
  60. extern void User_Error(PSZ Error,HWND hwndFrame,HWND hwndClient,PSZ ErrModule,LONG ErrLine);
  61.  
  62.