Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Suppress "Runtime error" in CWebBrowser2

Posted on 2008-06-13
Last Modified: 2013-11-20
I am using CWebBrowser2 to show HTML.
When I load HTML pages I get the following message:
"A Runtime Error has occurred.
Do you wish to Debug?

Line: 0
Error: Object expected"
I tried to suppress the erros using "SetSilent(TRUE)".
I does suppress the error, but it waits a lot of time for smething (minutes).

Question by:VapiSoft
  • 6
  • 2
LVL 40

Expert Comment

ID: 21785186
Try this: -

Go to your Internet Explorer web browser settings and disable script debugging.

Open "Internet Properties" and click on the "Advanced" tab. Look for the group called "Browsing" and tick the boxes "Disable script debugging (Internet Explorer)" and "Disable script debugging (other)". You might also want to untick "Display a notification about every script error".
LVL 40

Accepted Solution

evilrix earned 500 total points
ID: 21785196
Official documentation: http://msdn.microsoft.com/en-us/library/ms241741.aspx

How to: Enable Script Debugging in Internet Explorer

Before you can use Visual Studio to debug script running in Internet Explorer, you must enable script debugging in Internet Explorer. Script debugging in Internet Explorer is disabled by default.

To Enable Script Debugging in Internet Explorer
In Internet Explorer, choose Internet Options from the Tools menu.

In the Internet Options dialog box, click the Advanced tab.

On the Advanced tab, under Browsing, clear Disable Script Debugging.

Click OK.

LVL 40

Expert Comment

ID: 21785201
^^^ Obviously, do the opposite -- sorry, I forgot to point that out :)
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center


Author Comment

ID: 21786171
Hi evilrix,

You did not understand the question.
I use the CWebBrowser2  in my program.
I am not interested in disabling it in the IE browser because I cannot (and don't want to) change the user's settings. I need something that disables the same thing in the CWebBrowser2  control.
LVL 40

Expert Comment

ID: 21786246
>> You did not understand the question.
I assure you I did understand your question, completely!

>> I use the CWebBrowser2  in my program.
And this uses the Internet Settings to control its behavior

>> I am not interested in disabling it in the IE browser because I cannot (and don't want to) change the user's settings. I need something that disables the same thing in the CWebBrowser2  control.
This is a setting that is controlled by the users Internet Settings.

Did you try it?

Author Comment

ID: 21786299
Hi evilrix,

OK, I tried it (althought it is not what I want). I checked all 3 check-boxes (disable).
Now I receive a differnet error messages. It is a biiget dialog-box with the title (Internet Explorer Script Error). So I could suppress the error messages.
But even if I did work, I need to do it from the program (how?) and only for my control (so I do not change the usere's settings).
LVL 40

Expert Comment

ID: 21786354
I'm sorry, as far as I know this is the only way to control this. It's basically an ActiveX control that embeds IE in your application.
LVL 40

Expert Comment

ID: 21838281
I don't really see why this is being closed. The answer given is correct. The fact it's not the answer wanted doesn't make it any less correct. The ActiveX control is the IE rendering engine and its behavior is controlled via the normal Internet Settings, as already explained.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
iSeries DB2 Query 2 96
how to monitor remote shell execution on linux 9 104
sumHeights2  challenge 7 114
"Black Box" Testing of Control System Software 2 69
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question