home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ocl150a.zip / OCL / Samples / GTakPM / Source / GTPMException.cpp < prev    next >
C/C++ Source or Header  |  1996-08-12  |  1KB  |  57 lines

  1. // GTakPM
  2. // (c) Benjamin Stein 1994
  3. // All Rights Reserved
  4. // GTPMException.cpp
  5.  
  6. // $Header: W:/Projects/OCL/Samples/GTakPM/Source/rcs/GTPMException.cpp 1.50 1996/08/11 23:48:07 B.STEIN Release $
  7.  
  8. #include "..\Source\GTakPM.hpp"
  9.  
  10.  
  11. // default exception class
  12. // the error message is retrieved from the application resources
  13. // assume non-fatal error
  14. // these exceptions are caught by the catch-blocks in OXApp::run
  15.  
  16. GTPMException::GTPMException(const ULONG errResource,
  17.                              const ULONG severity)
  18.   : OPMException(errResource, 0, severity)
  19.   {}
  20.  
  21. GTPMException::~GTPMException()
  22.   {}
  23.  
  24.  
  25.  
  26. // implementation of system exception handling
  27.  
  28. SystemHandler::SystemHandler()
  29.  : OXcptPM(FALSE) 
  30.  {}
  31.  
  32. SystemHandler::~SystemHandler()
  33.  {}
  34.  
  35. BOOL SystemHandler::killTrace()
  36. {
  37.  OMsgs   msg;
  38.  OString Title(30);
  39.  OString Question(100);
  40.  
  41.  msg.loadString(APP_TITLE, 30, Title);
  42.  msg.loadString(SURE_TO_EXIT, 100, Question);
  43.  if (WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, Question, Title,
  44.                    GTPM_ICO, MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON1)==MBID_YES)
  45.     WinPostMsg(NULLHANDLE, WM_QUIT, (MPARAM)0, (MPARAM)100);
  46.  return(TRUE);    // continue by default 
  47. }
  48.  
  49.  
  50. BOOL SystemHandler::trapTrace()  
  51. {
  52.  return(FALSE);   // abort after viewing the exception message
  53. }
  54.  
  55.  
  56. // end of source
  57.