Trapping unhandled exceptions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I trap an unhandled exception using .NET compact framework? In the
full framework, you can use the AppDomain.UnhandledException event, but that
doesn't appear to be in the compact framework. Is it necessary to pinvoke
the SetUnhandledExceptionFilter API function? If so, does anyone have some
example code of doing that in C#?

Thanks...
Dan
 
There is no way to trap unhandled exception in CF1.0 (as you noticed,
Application.ThreadException and AppDomain.UnhandledException are not
supported). However, we have AppDomain.UnhandledException in CF2.0.
 
....exactly. Some links with more detail:
http://www.danielmoth.com/Blog/2004/08/global-exception-handling-net-cf-v10.html
http://www.danielmoth.com/Blog/2004/12/appdomainunhandledexception-part-1.html

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Sergey Bogdanov said:
There is no way to trap unhandled exception in CF1.0 (as you noticed,
Application.ThreadException and AppDomain.UnhandledException are not
supported). However, we have AppDomain.UnhandledException in CF2.0.

--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com

How can I trap an unhandled exception using .NET compact framework? In
the full framework, you can use the AppDomain.UnhandledException event,
but that doesn't appear to be in the compact framework. Is it necessary
to pinvoke the SetUnhandledExceptionFilter API function? If so, does
anyone have some example code of doing that in C#?

Thanks...
Dan
 
Is it possible to pinvoke SetUnhandledExceptionFilter?

Daniel Moth said:
....exactly. Some links with more detail:
http://www.danielmoth.com/Blog/2004/08/global-exception-handling-net-cf-v10.html
http://www.danielmoth.com/Blog/2004/12/appdomainunhandledexception-part-1.html

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Sergey Bogdanov said:
There is no way to trap unhandled exception in CF1.0 (as you noticed,
Application.ThreadException and AppDomain.UnhandledException are not
supported). However, we have AppDomain.UnhandledException in CF2.0.

--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com

How can I trap an unhandled exception using .NET compact framework? In
the full framework, you can use the AppDomain.UnhandledException event,
but that doesn't appear to be in the compact framework. Is it necessary
to pinvoke the SetUnhandledExceptionFilter API function? If so, does
anyone have some example code of doing that in C#?

Thanks...
Dan
 
Back
Top