Trapping unhandled exceptions

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
 
S

Sergey Bogdanov

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.
 
D

Daniel Moth

....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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top