External component has thrown an exception
- From: "Jared" <google@xxxxxxxxxxxxxxxxxxxxxx>
- Date: 4 May 2006 15:07:53 -0700
I seem to get this exception when I open forms using ShowDialog() from
event handlers. Consider the following:
private void cboCombo_SelectedIndexChanged(...)
{
try
{
(do something that raises an exception here)
}
catch(Exception ex)
{
try { (open a form with ShowDialog() here) }
catch {}
}
}
Somehow the SEHException is being thrown to Main() where it crashes the
app. The stack trace is as follows:
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at
System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at WinApp.MainForm.Main(String[] args) in mainform.cs:line 2078
I've gotten around this issue in the past by starting a timer in the
event handler, and then launching the form from the timer elapsed
event. That works ok, but gets cumbersome quickly.
I can provide code samples if necessary, but the code in question
really isn't doing anything spectacular. I don't see how the code
sample above could allow an exception to be thrown (without an explicit
throw, that is).
Does anyone have any experience with this issue?
TIA
.
- Prev by Date: Re: Word in a WinForm
- Next by Date: BindingSource from WebService
- Previous by thread: Does ClickOnce work well? Any disadvantages to it?
- Next by thread: BindingSource from WebService
- Index(es):
Relevant Pages
|