Solved

READYSTATE on WebBrowser Control

Posted on 2002-05-17
9
634 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I have been working with documentcomplete event all the time with no problem. I did never check for READYSTATE.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 12

Expert Comment

by:roverm
Comment Utility
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
Comment Utility
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
Comment Utility
Richie is always that lucky with his coding.... LOL Just kidding Richie!

D'Mzzl!
RoverM
0
 
LVL 16

Expert Comment

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

Author Comment

by:RichW
Comment Utility
Thanks for the A answer dude.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

763 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

9 Experts available now in Live!

Get 1:1 Help Now