I'm trying to handle exceptions on a fltk application under win32 and  
compiled with mingw 4.5.2 but it seems that the exceptions doesn't reach  
the main function, the program allways terminate without the exception  
been caught.

Someone else succeed catching exceptions or have a good strategy to mange  
errors with exception when programming with fltk ?

I've compiled fltk without "-fno-exceptions" and my entry code is this:

-----

#include "app.h"
#include "sqlite3.h"
#include "i18n_function.h"

int main(int argc, char **argv)
{
     sqlite3_enable_shared_cache(1);
     Fl_Input::default_number_format("\2,.");

     try
     {
         load_translations();

         //Fl::scheme("plastic");
         Fl::scheme("gtk+");
         //use partial match to find verdana font
         //Fl::visual(FL_RGB);
         //fltk.fl_register_images()
         set_app_font("erdana");

         Fl::add_focus_changing_handler(&fltk_Focus_Changing_Handler);

         //sqlite3 *db;
         //sqlite3_open("dadbiz.db", &db);
         MainWindow *win = new MainWindow();
#ifdef WIN32
         void *icon = (void *)LoadIcon(fl_display, "APP_ICON");
         if(icon) win->icon(icon);
#endif
         win->show(argc, argv);
         return Fl::run();
         delete win;
         //sqlite3_close(db);
     }
     catch(CppSqlException &e) //till now never caught
     {
         printf("%s\n", e.errorMessage());
         fl_alert(e.errorMessage());
     }
     catch(...) //till now never caught
     {
         printf("catch(...)\n");
         fl_alert(_tr("Something unexpected happened, please ask your  
provider !"));
     }
}
-------
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to