Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8341683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:33:26+00:00 2026-06-09T05:33:26+00:00

Short Version: I have a WinForms app that uses a .NET 4.0 WebBrowser control

  • 0

Short Version:

I have a WinForms app that uses a .NET 4.0 WebBrowser control to display an HTML page containing a Flash SWF file. The SWF file gets set up via some Javascript/jQuery/swf)iobject magic. Periodically, I run across a SWF file that will cause an AccessViolationException that stops my program. From what I can tell, this happens during the cleanup between showing one page and starting another (think automatic slideshow of web sites).

I’ve added AppDomain.CurrentDomain.UnhandledException and Application.ThreadException handlers, and my program still stops with a dialog on the screen. I want to prevent the dialog from showing up – how do I catch these types of exceptions and suppress them? I can restart my program or something – I can’t have a dialog show up.

Gory Details:

I’ve got the exception handlers mentioned above, plust some try/catch logic around places where I’m invoking behavior in my WebBrowser DOM via InvokeScript(). But nothing I’ve got in place seems to get called.

The exception generated looks like this:

Faulting application name: MyProgram.exe, version: 1.0.0.0, time stamp: 0x50096c59
Faulting module name: Flash64_11_3_300_257.ocx, version: 11.3.300.257, time stamp: 0x4fc81d71
Exception code: 0xc0000005
Fault offset: 0x000000000022b1db
Faulting process id: 0x10d0
Faulting application start time: 0x01cd668d0db086f8
Faulting application path: C:\Users\AUser\AppData\Local\Apps\2.0\AWMVPDR4.HEJ\Z9EP5M32.MQ4\mmm...tion_2c82cc3ef3e7d3e9_0001.0000_6ffd6d2ca43477ab\MyProgram.exe
Faulting module path: C:\Windows\system32\Macromed\Flash\Flash64_11_3_300_257.ocx
Report Id: a9f6977f-d284-11e1-a447-00187d1f4237

and then this:

Application: MyProgram.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
   at System.Windows.Forms.UnsafeNativeMethods+IDispatch.GetIDsOfNames(System.Guid ByRef, System.String[], Int32, Int32, Int32[])
   at System.Windows.Forms.HtmlDocument.InvokeScript(System.String, System.Object[])
   at MyProgram.InvokeScriptExtension+<>c__DisplayClass2.<InvokeScript>b__0()
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(System.Object)
   at System.Threading.ExecutionContext.runTryCode(System.Object)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
   at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.WebBrowserBase.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.WebBrowser.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG ByRef)
   at System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr, Int32, Int32)
   at System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)
   at System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)
   at MyProgram.Program.Main()

My challenge is to stop that exception from putting anything on the screen.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T05:33:28+00:00Added an answer on June 9, 2026 at 5:33 am

    OK – found something out about .NET 4. It wasn’t new, just new to me. Exception handling for unmanaged stuff works differently than it did in previous .NET versions (which I never really used, being somewhat of a newbie to .NET programming). The following links will hopefully provide some guidance and illumination…

    http://msdn.microsoft.com/en-us/library/dd638517.aspx

    Is it possible to catch an access violation exception in .NET?

    http://dotnetslackers.com/articles/net/All-about-Corrupted-State-Exceptions-in-NET4.aspx

    http://msdn.microsoft.com/en-us/magazine/dd419661.aspx

    There’s some claims that you can add a parameter to the app.config and get the old exception handling behavior. That didn’t work for me, but I won’t claim I did it properly. The description of adding the decorator to the Main() routine to enable the try/catch behavior did solve my problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .NET Winforms app (created in VS2005) that I deploy using ClickOnce.
Short version I have a facebook iframe app as a page tab on a
I have a short version of the question: I start a thread like that:
Here is the short version. I have a Bonus Activity that has 25 image
Short Version I have a list of int s that I need to figure
Short version: I have an MSBuild project that imports another project. There is a
The short version is that I have a protocol which has an optional parameter.
Ok, the short version is that I have a Linq entity from a LinqDataSourceUpdateEventArgs
Short version : VB.Net Windows forms feature controls that are often dragged from the
Short version : How can an MFC ActiveX control loaded into a web page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.