By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,573 Members | 1,797 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,573 IT Pros & Developers. It's quick & easy.

Getting strange InteropServices.SEHException exception

P: n/a
MJB
I never get the above exception in Windows 2k. It only happens in
Windows XP, which is the first oddity. My application is multi-threaded and
I use the webbrowser control and media player. The exception normally occurs
when I open the browser control or media control, but sometimes it just
occurs randomly. I was thinking first that it was some sort of build
difference with the COM interop components, but I re-referenced and rebuilt
everything on an XP machine and that didn't help. I'm now thinking it's
some sort of multi-threading error. I don't know, I'm at a loss. If anyone
has experienced a similar problem and can provide me with some info. I will
greatly appreciate it.

Here's the full exception dump:

System.Runtime.InteropServices.SEHException: External component has thrown
an exception.
at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
at
System.Windows.Forms.ComponentManager.System.Windo ws.Forms.UnsafeNativeMetho
ds+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason,
Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopI nner(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop( Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at MyApp.frmMain.Main() in C:\SoftwareDev\MyApp\MyApp
v5.0\SourceCode\MyApp\frmMain.cs:line 2901
Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
In article <Oc**************@TK2MSFTNGP12.phx.gbl>, MJB wrote:
I never get the above exception in Windows 2k. It only happens in
Windows XP, which is the first oddity. My application is multi-threaded and
I use the webbrowser control and media player. The exception normally occurs
when I open the browser control or media control, but sometimes it just
occurs randomly. I was thinking first that it was some sort of build
difference with the COM interop components, but I re-referenced and rebuilt
everything on an XP machine and that didn't help. I'm now thinking it's
some sort of multi-threading error. I don't know, I'm at a loss. If anyone
has experienced a similar problem and can provide me with some info. I will
greatly appreciate it.

Here's the full exception dump:

System.Runtime.InteropServices.SEHException: External component has thrown
an exception.
at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
at
System.Windows.Forms.ComponentManager.System.Windo ws.Forms.UnsafeNativeMetho
ds+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason,
Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopI nner(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop( Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at MyApp.frmMain.Main() in C:\SoftwareDev\MyApp\MyApp
v5.0\SourceCode\MyApp\frmMain.cs:line 2901


You wouldn't be updating the UI from a background thread would you? And
if you are, are you making sure your using .Invoke to do it?

Tom Shelton
Nov 20 '05 #2

P: n/a
MJB
Well, I am updating the UI from a background thread, but I am using Invoke.
I tried to investigate whether I missed something or not, but the debugger
isn't giving me much to go on.

The fact that it behaves differently on Win 2k vs Win XP is weird too,
unless they handle multi-threaded apps differently.
"Tom Shelton" <to*@mtogden.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
In article <Oc**************@TK2MSFTNGP12.phx.gbl>, MJB wrote:
I never get the above exception in Windows 2k. It only happens in
Windows XP, which is the first oddity. My application is multi-threaded and I use the webbrowser control and media player. The exception normally occurs when I open the browser control or media control, but sometimes it just
occurs randomly. I was thinking first that it was some sort of build
difference with the COM interop components, but I re-referenced and rebuilt everything on an XP machine and that didn't help. I'm now thinking it's
some sort of multi-threading error. I don't know, I'm at a loss. If anyone has experienced a similar problem and can provide me with some info. I will greatly appreciate it.

Here's the full exception dump:

System.Runtime.InteropServices.SEHException: External component has thrown an exception.
at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg) at
System.Windows.Forms.ComponentManager.System.Windo ws.Forms.UnsafeNativeMetho ds+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopI nner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop( Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at MyApp.frmMain.Main() in C:\SoftwareDev\MyApp\MyApp
v5.0\SourceCode\MyApp\frmMain.cs:line 2901


You wouldn't be updating the UI from a background thread would you? And
if you are, are you making sure your using .Invoke to do it?

Tom Shelton

Nov 20 '05 #3

P: n/a
MJB
I removed the entry:

Application.EnableVisualStyles();

from my main function, and so far it seems to be more stable. I have a few
more tests to run, but I hope this nipped it in the bud.

Thanks,
Matt
"MJB" <mb*@email.com> wrote in message
news:Oc**************@TK2MSFTNGP12.phx.gbl...
I never get the above exception in Windows 2k. It only happens in
Windows XP, which is the first oddity. My application is multi-threaded and I use the webbrowser control and media player. The exception normally occurs when I open the browser control or media control, but sometimes it just
occurs randomly. I was thinking first that it was some sort of build
difference with the COM interop components, but I re-referenced and rebuilt everything on an XP machine and that didn't help. I'm now thinking it's
some sort of multi-threading error. I don't know, I'm at a loss. If anyone has experienced a similar problem and can provide me with some info. I will greatly appreciate it.

Here's the full exception dump:

System.Runtime.InteropServices.SEHException: External component has thrown
an exception.
at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
at
System.Windows.Forms.ComponentManager.System.Windo ws.Forms.UnsafeNativeMetho ds+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopI nner(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop( Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at MyApp.frmMain.Main() in C:\SoftwareDev\MyApp\MyApp
v5.0\SourceCode\MyApp\frmMain.cs:line 2901

Nov 20 '05 #4

P: n/a
Hi MJB, Do you have Application.DoEvents after
Application.EnableVisualStyles??

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

" System.Reflection Master "

==== Converting to 2002 ====
Remove inline declarations
"MJB" <mb*@email.com> wrote in message
news:#y**************@TK2MSFTNGP09.phx.gbl...
I removed the entry:

Application.EnableVisualStyles();

from my main function, and so far it seems to be more stable. I have a few more tests to run, but I hope this nipped it in the bud.

Thanks,
Matt
"MJB" <mb*@email.com> wrote in message
news:Oc**************@TK2MSFTNGP12.phx.gbl...
I never get the above exception in Windows 2k. It only happens in
Windows XP, which is the first oddity. My application is multi-threaded

and
I use the webbrowser control and media player. The exception normally

occurs
when I open the browser control or media control, but sometimes it just
occurs randomly. I was thinking first that it was some sort of build
difference with the COM interop components, but I re-referenced and

rebuilt
everything on an XP machine and that didn't help. I'm now thinking it's
some sort of multi-threading error. I don't know, I'm at a loss. If

anyone
has experienced a similar problem and can provide me with some info. I

will
greatly appreciate it.

Here's the full exception dump:

System.Runtime.InteropServices.SEHException: External component has thrown an exception.
at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg) at

System.Windows.Forms.ComponentManager.System.Windo ws.Forms.UnsafeNativeMetho
ds+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32

reason,
Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopI nner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop( Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at MyApp.frmMain.Main() in C:\SoftwareDev\MyApp\MyApp
v5.0\SourceCode\MyApp\frmMain.cs:line 2901


Nov 20 '05 #5

P: n/a
I am getting the same problem. But I havent used
Application.EnableVisualStyles(); Specifically my error occurs on a return
from a dynamically created form, after a showdialog. Removing showdialog
removes the problem (but i dont know conclusively).
Thanks,
Hananiel

"MJB" <mb*@email.com> wrote in message
news:#y**************@TK2MSFTNGP09.phx.gbl...
I removed the entry:

Application.EnableVisualStyles();

from my main function, and so far it seems to be more stable. I have a few more tests to run, but I hope this nipped it in the bud.

Thanks,
Matt
"MJB" <mb*@email.com> wrote in message
news:Oc**************@TK2MSFTNGP12.phx.gbl...
I never get the above exception in Windows 2k. It only happens in
Windows XP, which is the first oddity. My application is multi-threaded

and
I use the webbrowser control and media player. The exception normally

occurs
when I open the browser control or media control, but sometimes it just
occurs randomly. I was thinking first that it was some sort of build
difference with the COM interop components, but I re-referenced and

rebuilt
everything on an XP machine and that didn't help. I'm now thinking it's
some sort of multi-threading error. I don't know, I'm at a loss. If

anyone
has experienced a similar problem and can provide me with some info. I

will
greatly appreciate it.

Here's the full exception dump:

System.Runtime.InteropServices.SEHException: External component has thrown an exception.
at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg) at

System.Windows.Forms.ComponentManager.System.Windo ws.Forms.UnsafeNativeMetho
ds+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32

reason,
Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopI nner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop( Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at MyApp.frmMain.Main() in C:\SoftwareDev\MyApp\MyApp
v5.0\SourceCode\MyApp\frmMain.cs:line 2901


Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.