Solved

Suppress "Runtime error" in CWebBrowser2

Posted on 2008-06-13
10
422 Views
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).

0
Comment
Question by:VapiSoft
[X]
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
  • 6
  • 2
10 Comments
 
LVL 40

Expert Comment

by:evilrix
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".
0
 
LVL 40

Accepted Solution

by:
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.

0
 
LVL 40

Expert Comment

by:evilrix
ID: 21785201
^^^ Obviously, do the opposite -- sorry, I forgot to point that out :)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:VapiSoft
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.
0
 
LVL 40

Expert Comment

by:evilrix
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?
0
 

Author Comment

by:VapiSoft
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).
0
 
LVL 40

Expert Comment

by:evilrix
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.
0
 
LVL 40

Expert Comment

by:evilrix
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.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ODBC Connection Logging, ADO.NET 6 71
twoTwo  challenge 35 113
Making an alias 7 114
Bartender label printing - switch on and off graphics 3 74
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.

749 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