Oh, I do plan to handle them. It is just that I want to do it in one place,
based on the exception type, instead of debugging all of this guys code.
I dont quite understand what you wrote about attaching an
UnhandledException event. Could you give me a few more details plz?
your help greatly appreciated.
thanks
LK
"Sean Hederman" <(E-Mail Removed)> wrote in message
news:cutiq8$fkp$(E-Mail Removed)...
> Just to add to this, it probably isn't the greatest idea to swallow these
> exceptions. They've been thrown for a reason. Pretending they don't exist
> will quite possibly leave the application in a worse state than just
> exiting.
>
> "Nicholas Paldino [.NET/C# MVP]" <(E-Mail Removed)> wrote
in
> message news:%(E-Mail Removed)...
> > Laxmikant,
> >
> > You will probably want to get the current AppDomain (through the
static
> > CurrentDomain property on the AppDomain class) and then attach to the
> > UnhandledException event.
> >
> > Hope this helps.
> >
> >
> > --
> > - Nicholas Paldino [.NET/C# MVP]
> > - (E-Mail Removed)
> >
> > "Laxmikant Rashinkar" <LK-at-televital-dot-com> wrote in message
> > news:%(E-Mail Removed)...
> >> Hi,
> >>
> >> I am working with a program that someone else wrote.
> >> This program is full of bugs and unhandled exceptions are thrown all
over
> >> the code.
> >> Instead of trying to catch the exception at each point it is thrown, I
am
> >> wondering
> >> if it is possible to catch all exceptions at a top level. I tried the
> >> following but it does not work.
> >> Does anyone have any ideas about how this can be achieved?
> >>
> >> thanks a lot
> >> LK
> >>
> >> -----
> >>
> >> class Form1 : System.Windows.Forms.Form
> >> {
> >>
> >> [STAThread]
> >> static void Main()
> >> {
> >> try
> >> {
> >> Application.Run(new Form1());
> >> }
> >> catch(Exception ex)
> >> {
> >> // unfortunately this does not catch any exceptions for me
> >> }
> >> }
> >>
> >> }
> >>
> >>
> >
> >
>
>