|
|
|
date: 17 Apr 2006 03:06:21 -0700,
group: microsoft.public.inetsdk.programming.html_objmodel
back
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
"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
|
|