Solved

READYSTATE on WebBrowser Control

Posted on 2002-05-17
9
639 Views
Last Modified: 2010-05-18
Hi all,

I'm navigating a Webbrowser control and I'm checking for the READYSTATE using:

Do While WebBrowser1.ReadyState < 4
    DoEvents
Loop

The problem is that it's been running at 3 for over a half hour now.

I ran this in work on a Win 98 machine with a proxy server Internet connection and had no problems.

Now I'm at home using Win XP Professional through a cable modem Internet connection.

I removed all firewalls and I have no problems surfing the net.

Any ideas?

Thanks

RichW
0
Comment
Question by:RichW
  • 4
  • 3
  • 2
9 Comments
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 100 total points
ID: 7017909
If you need to wait until page is downloaded, don't use that code. It wastes resources.
In documentcomplete event of webbrowser use code like this:
if (pdisp is webbrowser1.object) then
   ' do your stuff here
end if
0
 
LVL 4

Author Comment

by:RichW
ID: 7018172
Richie, the DocumentComplete event does fire off, but the READYSTATE still stays at 3.  I have already tried it.

I'm trying to capture the HTML of the page with
WebBrowser1.Document.body.innerhtml into a String variable.

Thanks anyway.
RichW

0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7018471
Strange. DocumentComplete fires for every frame that page could has, due to that i added a condition in my previous post.
By the way, if you need ALL contents of page use:
WebBrowser1.Document.documentelement.innerhtml
into a String variable
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7018473
I have been working with documentcomplete event all the time with no problem. I did never check for READYSTATE.
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 12

Expert Comment

by:roverm
ID: 7018735
If you just want the HTML to capture, why don't you use the Inetcontrol ? Way faster! And: an event when the document state changes (12 steps, AFAIK).

If you want this I can provide you with an complete example.
You can also use this method when you have to send parameters to the http server (POST and GET).

D'Mzzl!
RoverM
0
 
LVL 4

Author Comment

by:RichW
ID: 7020251
Thanks, Richie.  I don't know why, but yesterday your suggestion didn't work, and today it does.

Thanks roverm too.

RichW
0
 
LVL 12

Expert Comment

by:roverm
ID: 7020275
Richie is always that lucky with his coding.... LOL Just kidding Richie!

D'Mzzl!
RoverM
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7020735
That was because your comment was late...
:D
Thanks for "A" grade Rich.
0
 
LVL 4

Author Comment

by:RichW
ID: 7021248
Thanks for the A answer dude.
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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

895 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

17 Experts available now in Live!

Get 1:1 Help Now