home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 Mobile / Chip_Mobile_2001.iso / palm / business / printcar / printcar.exe / src / PrintCard.cc < prev    next >
C/C++ Source or Header  |  2000-06-05  |  1KB  |  45 lines

  1. //
  2. //  $Id: PrintCard.cc,v 1.2 2000/06/04 23:23:25 sergey Exp $
  3. //
  4.  
  5. #include <Pilot.h>
  6. #include "UI/Application.h"
  7. #include "PrintCardForm.h"
  8. #include "Util/Error.h"
  9.  
  10. #include "PrintCardRes.h"
  11.  
  12.  
  13. //-- Custom error handler class ------------------------------------------------
  14.  
  15. class CustomErrorHandler: public Util::ErrorHandler
  16. {
  17.     virtual void reportError(bool fatal, const char* message)
  18.     {
  19.         FrmCustomAlert(ID_ERROR_ALERT, (Char*)message, "", "");
  20.  
  21.         if (fatal)
  22.             SysReset();
  23.     }
  24. };
  25.  
  26. //------------------------------------------------------------------------------
  27.  
  28.  
  29. DWord PilotMain(Word cmd, Ptr cmdPBP, Word launchFlags)
  30. {
  31.     if (cmd == sysAppLaunchCmdNormalLaunch)
  32.     {
  33.         // setup application custom error handler
  34.         CustomErrorHandler errorHandler;
  35.         Util::Error::setErrorHandler(errorHandler);
  36.  
  37.         PrintCardForm mainForm;
  38.         UI::Application app;
  39.  
  40.         app.run(mainForm, evtWaitForever);
  41.     }
  42.  
  43.     return 0;
  44. }
  45.