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

  • SEARCH
  • Home
  • 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 7065063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:54:38+00:00 2026-05-28T04:54:38+00:00

I am having the exact same issue with a WinForms WebBrowser control and the

  • 0

I am having the exact same issue with a WinForms WebBrowser control and the onbeforeunload javascript event handling as this post (How to intercept the onbeforeunload event in a WebBrowser control?). I tried the same solution as presented to cast the onbeforeunload event to IDispatch and call the Invoke method. I get this error when doing so:

hr = -2147352319

I’m developing in .NET 3.5 on WinXP using IE 6.0.

I did not put the C# code here because it is exactly the same as the linked article above.

The JavaScript code is :

function onBeforeUnload()
{
    if (window.cObject.isTransferred)
    {
        event.returnValue = "\nYou are requesting to exit.\n";                   
    }
    else
    {
        event.returnValue = "\nYou are DELETING this object!!!\n";
    }
}
  • 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-05-28T04:54:39+00:00Added an answer on May 28, 2026 at 4:54 am

    The error translates to 0x80020101, which in turn translates to SCRIPT_E_REPORTED (here’s a how-to do this yourself). Microsoft has a confirmed bug that they say occurs often on multicore or multi-processor computers, but may occur on single processor computers as well. Microsoft explains that it has to do with the invocation of the COM interfaces.

    This backs up the story in your referred to thread, where the user eventually follows Hans Passant’s answer, but receives this error. By changing the P/Invoke declarations, he manages to solve the problem (the answer is written in the question itself).

    Yet another source suggests that this might also mean an error in the script itself. If that’s the case, you should be able to catch the script error by handling onScriptError.

    My suggestions:

    • try the suggested alternative approach in the referred thread (if you haven’t tried so already)
    • create a handler for onScriptError

    EDIT: the OP has tried some suggestions and found out that this was above all a JavaScript error (my second suggestion): instead of event, window.event should’ve been used, or a common event access technique as described in this Quirksmode article.

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

Sidebar

Related Questions

This is a really weird issue I'm having and I'm not really sure what
The answer to this SO explains the issue I'm having: HashSet.remove() and Iterator.remove() not
i have been having this issue for some time now, and have not gotten
I've already looked around but couldn't find the exact solution/problem I'm having right now.
Having a heckuva time with this one, though I feel I'm missing something obvious.
Having a problem getting a TreeView control to display node images. The code below
Having programmed through emacs and vi for years and years at this point, I
Having this route: map.foo 'foo/*path', :controller => 'foo', :action => 'index' I have the
I am having an issue with creating and adding sales/quote_address objects to the multishipping
I am having problems getting the GTK designer to work with MonoDevelop. I tried

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.