Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: 17 Apr 2006 03:06:21 -0700,    group: microsoft.public.inetsdk.programming.html_objmodel        back       


using IHTMLDoument2::write() in a loop   
Hi,
I'm using IHTMLDoument2::write() in a loop and I want the document to
be displayed everytime I write something new to it so that I can see
text appearing incrementally on the browser. I'm trying to do this by
using IHTMLDoument2::execCommand() with the command "Refresh" after
each write().  I also tried using the IWebBrowser2::Refresh() after
each write(), but I cannot acieve the desired effect.  I am only able
to see the complete text after all the write() calls.  If I put in a
MessageBox after each write(), I can see the lines appearing one by one
after each MessageBox, but I cannot get them to appear one by one
otherwise. 

Any suggestions will be appreciated,
thanks.
date: 17 Apr 2006 03:06:21 -0700   author:   huda

Re: using IHTMLDoument2::write() in a loop   
"huda"  wrote in message
news:1145268381.424883.52090@u72g2000cwu.googlegroups.com
> I'm using IHTMLDoument2::write() in a loop and I want the document to
> be displayed everytime I write something new to it so that I can see
> text appearing incrementally on the browser. I'm trying to do this by
> using IHTMLDoument2::execCommand() with the command "Refresh" after
> each write().  I also tried using the IWebBrowser2::Refresh() after
> each write(), but I cannot acieve the desired effect.  I am only able
> to see the complete text after all the write() calls.

Since you are spinning in a tight loop, you simply don't give the 
browser window a chance to repaint itself. You should return to the 
message pump occasionally to allow the window to process pending 
messages.

Instead of a tight loop, try posting yourself a user-defined message 
after each line written. In response to the message, write another line 
and post the message again, and so on.
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Mon, 17 Apr 2006 07:41:23 -0400   author:   Igor Tandetnik

Re: using IHTMLDoument2::write() in a loop   
Thanks for the prompt reply. That is probably what is happening, that
the window doesn't have a chance to repaint itself, but how exactly do
I return to the message pump after a write()? And how do I post a
user-defined message? I'm giving it enough time to repaint because it
takes a couple of seconds to get to each write(), but I don't know how
to force it to repaint. Can you please be a bit specific?
thanks.
date: 18 Apr 2006 00:07:00 -0700   author:   huda

Re: using IHTMLDoument2::write() in a loop   
"huda"  wrote in message
news:1145344020.819110.11640@i40g2000cwc.googlegroups.com
> Thanks for the prompt reply. That is probably what is happening, that
> the window doesn't have a chance to repaint itself, but how exactly do
> I return to the message pump after a write()? And how do I post a
> user-defined message?

See PostMessage

> I'm giving it enough time to repaint because it
> takes a couple of seconds to get to each write()

But you are doing something during these two seconds, not just sitting 
idle, right? Your calculations as well as window repainting happen on 
the same thread. If the thread is busy doing your work, it can't do the 
painting.
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Tue, 18 Apr 2006 07:01:39 -0400   author:   Igor Tandetnik

Re: using IHTMLDoument2::write() in a loop   
Thanks for the help, and the explanation.

I'm still working on using PostMessage (and SendMessage) with
variations but nothing has worked yet. If anything else comes to mind
please let me know.

The application I'm working on is a plugin for Internet Explorer and
I'm also trying to see if there is a message that I can send to the IE
window that will make it reload itself - is that possible?
date: 21 Apr 2006 10:44:30 -0700   author:   huda

Re: using IHTMLDoument2::write() in a loop   
"huda"  wrote in message
news:1145641470.110257.58590@u72g2000cwu.googlegroups.com
> The application I'm working on is a plugin for Internet Explorer and
> I'm also trying to see if there is a message that I can send to the IE
> window that will make it reload itself - is that possible?

I'm not sure what you are asking, but see if IWebBrowser2::Refresh[2] 
helps.
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Fri, 21 Apr 2006 19:47:48 -0400   author:   Igor Tandetnik

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us