home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool.zip / OOL / include / xexcept.h < prev    next >
C/C++ Source or Header  |  1997-04-03  |  1KB  |  39 lines

  1. #ifndef __OOL_XEXCEPT_H__
  2. #define __OOL_XEXCEPT_H__
  3.  
  4. /*===========================================================================*/
  5. /* OOL ------------------- the Open Object Library ------------- OS/2 Beta 1 */
  6. /*===========================================================================*/
  7. /*                              class: XException                            */
  8. /*                       derived from: XObject                               */
  9. /*                        last update: 3/97                                  */
  10. /*                      programmed by: Stefan von Brauk (sbrauk@gwdg.de)     */
  11. /*===========================================================================*/
  12.  
  13. #include "xobject.h"
  14. #include "xstring.h"
  15. #include <stdio.h>
  16.  
  17. class XWindow;
  18.  
  19. #if defined( __WATCOMC__ )
  20. class _export_ XException
  21. #else
  22. class _export_ XException//: public XObject
  23. #endif
  24. {
  25.       XString msg, file;
  26.       LONG code, line;
  27.    public:
  28.       XException(char * errorMsg, LONG errorCode, LONG lineNumber=0, char * fileName="")
  29.                 { msg = errorMsg; code = errorCode; line = lineNumber; file = fileName; }
  30.       char * GetErrorMessage(void) { return (char*) msg; }
  31.       LONG GetErrorCode(void) { return code; }
  32.         void ShowError( XWindow * w=NULL);
  33.         void PrintError(void);
  34. };
  35.  
  36. #define OOLThrow(a, b) throw( XException(a, b, __LINE__, __FILE__))
  37.  
  38. #endif
  39.