mfc >> How can I force CHtmlView to load local webpage?

by Aggro » Sun, 30 Nov 2003 05:20:20 GMT

How can I force CHtmlView to load local webpage? It seems to me that it
will load the page only after the program is on idle. (When it does no
calculation, and it is not in Sleep.)

This is not good for me, because I would need to update the page
instantly, and right after that do some calculations that might take a
second or so. (The update can't wait that long, and they must be done in
this order.)

Currently I have solved this by using timer and checking when the page
has loaded and committed the heavy calculation after if has. But this
really is a crappy way to do it IMHO, because I have a lot of other
things to do with timer also and this really mixes up the program logic.

I don't know if it matters, but the dialog where I'm showing the
htmlview is a modaless child dialog (I'm showing two dialogs at the same
time.)

I have tried UpdateWindow()( for both the main- and the child dialog )
and many other solutions also. And I tried also searching newsgroups and
the Internet for hours. No luck.



mfc >> How can I force CHtmlView to load local webpage?

by Johan Rosengren » Sun, 30 Nov 2003 16:10:43 GMT


Aggro,

This is a common problem - not exactly with CHtmlView, but rather displaying
a window, starting an operation and then update the window. We don't want
the window or dialog to be completely blank during this startup period :-)))
ONe of the most common methods is to - from OnInitDialog - *post* a user
defined message to ourselves. As it is posted, it will be put last in the
queue, the dialog box initialization will continue (and so show the dialog),
and then our handler for the message will be called, and there the
calculation is started. I find this slightly disjointed, but, as stated, the
problem is common, and so is the solution :-)))

Johan Rosengren
Abstrakt Mekanik AB

"Aggro" < XXXX@XXXXX.COM > a rit dans le message de






mfc >> How can I force CHtmlView to load local webpage?

by Aggro » Mon, 01 Dec 2003 00:05:50 GMT





The problem is not within the OnInitDialog. It is later after the dialog
is created. When I try to navigate to next webpage. ( I will have to
navigate to hundreds of webpages in the same day as the program is used. )

And I have two dialogs, so sending a message to one queu doesn't
guarantee that the dialog I want to update, will update, before the
calculation is done in the other dialog. Or does it? ( The dialog which
I want to update is nothing but a slave dialog that shows a webpage that
the first dialog creates. In the beginning of calculations. )

And I have no problem updating _the dialog_. Only problem is that
CHtmlView doesn't update when I update the dialog. It just waits untill
everything is on idle.



How can I force CHtmlView to load local webpage?

by Johan Rosengren » Mon, 01 Dec 2003 15:14:17 GMT


"Aggro" < XXXX@XXXXX.COM > a rit dans le message de


displaying
<snip>

You have *one* queue for your app, but of course you're also supposed to
post to the appropriate dialog :-)


I think I got that the first time around, but my explanation might be
lacking in clarity:

Old method:

1. Navigating somewhere, HTML-dialog not yet updated (should have been here)
2. Calculating something
3. App starts processing messages, HTML-dialog updated.

Posting should give something like the following:

1. Navigating somewhere, HTML-dialog not yet updated.
2. Posting message to self to start calculation
3. App starts processing messages, HTML-dialog updated
4. Posted message acted upon, lengthy calculation starts.
...

Johan Rosengren
Abstrakt Mekanik AB




Similar Threads

1. How to force CHtmlView refress()?

Hi,
I have to use CHtmlView for browsing the html page with dialog.

I have tow dialogs:
 First dialogs view the html page with the images, when I click on  one 
image, this will popup up second dialog(a new dialog) to list details about 
this image,
I have some processing with the second dialog, when it finished I will close 
the dialog and go to first dialog again, before (or also for after) I close 
the second dialog I do refresh for with the page on first dialog by calling 
m_myHtmlControl.refresh() or also for 
m_myHtmlControl.refresh2(3,NULL,NULL.NULL) ;

But this cause system error.
How to fix this bug? please help me soon for any solution to do refresh in 
this case...
Thank in advance!

Tri


2. Linking webpages from Internet to local folder - CSharp/C#

3. Local Document in CHtmlView

Hello,

If I want to display local HTML data in a CHtmlView, do I need to write that 
data to a local file, and then tell the View to Navigate to that file? 

Or is there a way to directly load the HTML into the HtmlView?

Thank you very much,
Rich

4. holding a system message till a webpage loads - CSharp / C#

5. Load webpage

Hi,

I would like to know if there's a way to load a webpage, like
www.google.ca on a CSharp app then execute a query like a search on the
string "csharp" on the google's text area, then execute the search and
load the new webpage(results) so i can now extract the information i
want to put on a DB or text file.
I don't know if i'm clear because english isn't my mothertongue.

Thank you for any help!

6. percentage loaded of webpage

7. Load XML from webpage to use with TinyXML

8. CHtmlView: Detect when a refreshed page has loaded