Exception manager?

  • Thread starter Thread starter Zanna
  • Start date Start date
Z

Zanna

Hi all,

Someone can tell me if exists a way to handle an exception at
application level?

I want to do a single procedure that handle (do a messagebox) an
exception raised I-don't-know-where in the program.

Is it possible?

Thanks
 
There is no any global exception handler in Compact Framework.
I am using this code to globally catch exceptions:

Form form = new Form();
while (true) {
try{
Application.Run(form);
} catch (Exception e) {
if (MessageBox.Show( "Error:" + e.ToString() + " Exit Application?", "Fatal Error",
MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes) {
break;
} else {
continue;
}
}
}

Alex.
 
Back
Top