Google Groups Home
Help | Sign in
MSHTML remains in ReadyState_Interactive forever (when the control window is not yet visible)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Thomas Zangl  
View profile
 More options Feb 21 2005, 9:19 am
Newsgroups: microsoft.public.inetsdk.programming.dhtml_editing
From: Thomas Zangl <use...@tzis.net>
Date: Mon, 21 Feb 2005 15:19:09 +0100
Local: Mon, Feb 21 2005 9:19 am
Subject: MSHTML remains in ReadyState_Interactive forever (when the control window is not yet visible)
Hi,

I came over a portion of code like this (Delphi):
(FIE is a TWebBrowser - Embedded IE Control)

FIE.Navigate(Filename);
while (FIE.ReadyState <> ReadyState_Complete) do
   Application.ProcessMessages;

This does nothing else than loading a file/url into the Browser. So far
so good - it works if the MSHTML Window is visible. If the MSHTML Window
is NOT visible it remains in this state: ReadyState_Interactive
(According to MSDN this means: Object is interactive, but not all of its
data is available.) Why is MSHTML not proceeding? My app is ending in an
endless loop because of this :-/

TIA,
--
----------------------------------------------------------------
,yours Thomas Zangl -tho...@tzi.dhs.org- -TZ1-6BONE-
-http://tzi.dhs.org - http://www.borg-kindberg.ac.at
Use YAMC! now! Get it at http://www.borg-kindberg.ac.at/yamc/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Charles Law  
View profile
 More options Feb 21 2005, 9:55 am
Newsgroups: microsoft.public.inetsdk.programming.dhtml_editing
From: "Charles Law" <bl...@nowhere.com>
Date: Mon, 21 Feb 2005 14:55:57 -0000
Local: Mon, Feb 21 2005 9:55 am
Subject: Re: MSHTML remains in ReadyState_Interactive forever (when the control window is not yet visible)
Hi Thomas

I suspect that this is 'by design'. The WebBrowser control is designed for
rendering html pages. If the control is not visible then the content is not
rendered, and if it is not rendered then the data is not available.

Charles

"Thomas Zangl" <use...@tzis.net> wrote in message

news:37u8ufF5ir200U1@individual.net...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thomas Zangl  
View profile
 More options Feb 21 2005, 10:12 am
Newsgroups: microsoft.public.inetsdk.programming.dhtml_editing
From: Thomas Zangl <tho...@tzis.net>
Date: Mon, 21 Feb 2005 16:12:58 +0100
Local: Mon, Feb 21 2005 10:12 am
Subject: Re: MSHTML remains in ReadyState_Interactive forever (when the control window is not yet visible)

Charles Law wrote:

Hi!

> I suspect that this is 'by design'. The WebBrowser control is designed for
> rendering html pages. If the control is not visible then the content is not
> rendered, and if it is not rendered then the data is not available.

That renders MSHTML to be useless to me :-/ I can live with the fact
that it is inactive but this also means that the Document Object has no
body elemtn (FDocument.body is nil) - so I canīt modify/load any HTML
into the control :-/

Any idea how to mimic the behavior of DHTML beside some dirty "OnShow"
event hacks?

--
Thomas


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Charles Law  
View profile
 More options Feb 21 2005, 11:34 am
Newsgroups: microsoft.public.inetsdk.programming.dhtml_editing
From: "Charles Law" <bl...@nowhere.com>
Date: Mon, 21 Feb 2005 16:34:31 -0000
Local: Mon, Feb 21 2005 11:34 am
Subject: Re: MSHTML remains in ReadyState_Interactive forever (when the control window is not yet visible)
Do you require the rendering features? If that is the case, and you will
never want to show the page, you don't need the full WebBrowser control.
Instead, just use mshtml. Note that the WebBrowser wraps mshtml and shdocvw.
The latter provides the rendering services whilst the former maintains the
DOM.

You can create and manipulate a page in memory using just mshtml. You will
need the IPersistStreamInit interface exposed by the document object.

Navigate to about:blank on a new HTMLDocument object and wait for complete.
Call InitNew on the IPersistStreamInit interface.
Call Load to load a string.
Wait for complete.

If you need to view the page can you not allow the control to be visible?

Charles

"Thomas Zangl" <tho...@tzis.net> wrote in message

news:urclMfCGFHA.2572@tk2msftngp13.phx.gbl...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thomas Zangl  
View profile
 More options Feb 21 2005, 12:57 pm
Newsgroups: microsoft.public.inetsdk.programming.dhtml_editing
From: Thomas Zangl <use...@tzis.net>
Date: Mon, 21 Feb 2005 18:57:43 +0100
Local: Mon, Feb 21 2005 12:57 pm
Subject: Re: MSHTML remains in ReadyState_Interactive forever (when the control window is not yet visible)

Charles Law wrote:

Hi!

> Do you require the rendering features?

More or less: yes.
Not really immediatly, but after I loaded/modified the HTML code it
should be displayed/editable.

> Navigate to about:blank on a new HTMLDocument object and wait for complete.
> Call InitNew on the IPersistStreamInit interface.
> Call Load to load a string.
> Wait for complete.

Idea:

I create an IHTMLDocument2 object - fill and modify it. How can I now
attach the object to the Webbrowser object?
Maybe someone can provide me sample code? :)

> If you need to view the page can you not allow the control to be visible?

I can - but in the same procedure I want load the HTML string into the
control.... so it might not matter if its visible or not :-/

Best regards,
--
----------------------------------------------------------------
,yours Thomas Zangl -tho...@tzi.dhs.org- -TZ1-6BONE-
-http://tzi.dhs.org - http://www.borg-kindberg.ac.at
Use YAMC! now! Get it at http://www.borg-kindberg.ac.at/yamc/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
geoff_syndicate  
View profile
 More options Feb 21 2005, 4:28 pm
Newsgroups: microsoft.public.inetsdk.programming.dhtml_editing
From: geoff_syndicate <mud...@mobsters.com>
Date: Tue, 22 Feb 2005 10:28:41 +1300
Local: Mon, Feb 21 2005 4:28 pm
Subject: Re: MSHTML remains in ReadyState_Interactive forever (when the control window is not yet visible)

Charles Law wrote:
> Hi Thomas

> I suspect that this is 'by design'. The WebBrowser control is designed for
> rendering html pages. If the control is not visible then the content is not
> rendered, and if it is not rendered then the data is not available.

> Charles

I use the WebBrowser control in this way with no problems.  I use dirty
old Visual Basic, and my WebBrowser control is hidden and I wait until
it's finished loaded and then access the HTMLDocument interface.  Here
is the code I use:

     If ie.Offline = True Then
         pageTimer.Duration = 10000
     Else: pageTimer.Duration = 60000
     End If

     pageTimer.Enabled = True
     ie.Visible = False
     ie.Navigate strLocation

     Do While ie.ReadyState <> READYSTATE_COMPLETE
         DoEvents
         If pageTimer.TimeRemaining = 0 Then
             ie.Stop
             Exit Do
         End If
     Loop

     pageTimer.Enabled = False

     DoEvents
     Set thisIE = ie.Document
     DoEvents
     Set thisIEWindow = thisIE.parentWindow
     DoEvents

'ie' is the webBrowser and 'thisIE' is an HTMLDocument variable.
thisIEWindow is an HTMLWindow variable.
I have included a timer to abort the load if it seems to be in an
infinite loop.

This is quite basic but works well.

Geoff


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google