Solved

Suppress "Runtime error" in CWebBrowser2

Posted on 2008-06-13
10
419 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
  • 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
fizzArray  challenge 1 57
post4 challenge 28 91
matchUp  challenge 9 91
Change to event 1 99
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. …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

948 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now