Solved

READYSTATE on WebBrowser Control

Posted on 2002-05-17
9
656 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
[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
  • 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
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!

 
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
 
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

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
Error when passing an argument to a vb6 that contains  '/' 7 49
How to Add / Edit Windows Menu 4 80
Spell Check in VB6 13 147
Zip Folders Using Chilkat Routines 1 86
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

734 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