🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #1397

How to properly wait for TCPPWebbrowser to be ready...

#1397
From: Tom
Date: Mon, 29 Jan 2007 13:40
36 lines
2013 bytes
I've got everything working as it stands, however the program is
jumping to 99% cpu usage when it's waiting for the browser to
finish it's action. What I'd like to know, is how to wait without
being such a hog.

Here's the scenario:

I load up a web page, then using the IHTMLDocument3 I get
access to the controls I need by Id and modify them. When
that's done I use the click() function to submit the form.

The form is AJAX based, so I have to wait until that action is
completed before finally obtaining the source code from the
results div. In order to determine when to stop waiting I'm
checking the Style of another div to see if it's set back to hidden.
When the ajax portion is running the div is visible
(just says "Loading...please wait") and when it's not the div is
set to hidden.

So anyways, what I've got now for the loop is this:

WideString S;
do
{
   TComInterface <IHTMLStyle> Style;
  Element->get_style(&Style);
  Style->get_display(&S);
}while(S == WideString(""));

I've also noticed the program appears to be locked up during this
loop.  I added Application->ProcessMessages() to the loop but
that didn't help.

Thanks,

Tom
Technical Details
Message-ID: <45bdf8f5$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,d1b56cd84b3a485d,start
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Tom" <tom@nospam.net>
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: How to properly wait for TCPPWebbrowser to be ready...
Date: Mon, 29 Jan 2007 07:40:03 -0600
Lines: 38
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 68.1.78.156
Message-ID: <45bdf8f5$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1170077941 68.1.78.156 (29 Jan 2007 05:39:01 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail