S
Scott Gifford
Hello,
In my Main() method in Program.cs, I have an exception handler around
my Application.Run(). If I catch an exception, I would like to bring
up a dialog box asking the user if they would like to send an error
report.
In my first attempt, I created the form for the dialog box, then tried
to restart the message loop with another call to Application.Run().
Unfortunately, this call to Appliction.Run() immediately throws an
exception. The documentation says that this will happen if I try to
start a message loop on a thread that is already running a message
loop, and Application.Run() seems to think the message loop is still
running. Perhaps this is because it was exited abnormally via an
exception.
In my second attempt, I starting a new thread, and called
Application.Run() from there. This works, but adds a lot of clutter
to an otherwise straightforward piece of code, and seems a bit kludgey
besides.
Is there a better way to do this?
Thanks!
----Scott.
In my Main() method in Program.cs, I have an exception handler around
my Application.Run(). If I catch an exception, I would like to bring
up a dialog box asking the user if they would like to send an error
report.
In my first attempt, I created the form for the dialog box, then tried
to restart the message loop with another call to Application.Run().
Unfortunately, this call to Appliction.Run() immediately throws an
exception. The documentation says that this will happen if I try to
start a message loop on a thread that is already running a message
loop, and Application.Run() seems to think the message loop is still
running. Perhaps this is because it was exited abnormally via an
exception.
In my second attempt, I starting a new thread, and called
Application.Run() from there. This works, but adds a lot of clutter
to an otherwise straightforward piece of code, and seems a bit kludgey
besides.
Is there a better way to do this?
Thanks!
----Scott.