home *** CD-ROM | disk | FTP | other *** search
- //
- // $Id: PrintCard.cc,v 1.2 2000/06/04 23:23:25 sergey Exp $
- //
-
- #include <Pilot.h>
- #include "UI/Application.h"
- #include "PrintCardForm.h"
- #include "Util/Error.h"
-
- #include "PrintCardRes.h"
-
-
- //-- Custom error handler class ------------------------------------------------
-
- class CustomErrorHandler: public Util::ErrorHandler
- {
- virtual void reportError(bool fatal, const char* message)
- {
- FrmCustomAlert(ID_ERROR_ALERT, (Char*)message, "", "");
-
- if (fatal)
- SysReset();
- }
- };
-
- //------------------------------------------------------------------------------
-
-
- DWord PilotMain(Word cmd, Ptr cmdPBP, Word launchFlags)
- {
- if (cmd == sysAppLaunchCmdNormalLaunch)
- {
- // setup application custom error handler
- CustomErrorHandler errorHandler;
- Util::Error::setErrorHandler(errorHandler);
-
- PrintCardForm mainForm;
- UI::Application app;
-
- app.run(mainForm, evtWaitForever);
- }
-
- return 0;
- }
-