Article View: borland.public.cppbuilder.internet.socket
Article #1407Re: How to properly wait for TCPPWebbrowser to be ready...
From: Tom
Date: Tue, 30 Jan 2007 01:11
Date: Tue, 30 Jan 2007 01:11
40 lines
2454 bytes
2454 bytes
Remy, > You need to call Application->ProcessMessages() periodically in your > loop. Maybe also Sleep() as well. I tried this before posting and it didn't seem to have much of an effect. I moved the code from my test app into the actual program and it doesn't seem to lock up nearly as bad. > Also, your loop is checking for a blank "display" property, which may > not always be blank, even when the div disappears. It might be > getting set to "none" instead of "". Correct, as soon as it's done loading display goes to none. That's why I loop until it's set with something. > Amsuming the page is using an XMLHttpRequest object, you could try > hooking its onreadystatechange event, and then query its readystate > property when it changes to see when the tansmission is finished (or > just query the readystate in a loop instead of using an event). You > can also retrieve the data of the response, if needed. Ah great, that's what I was hoping for. I'll give that a shot. > The OnDocumentComplete event is the most ideal place for that logic. Correct, though the web page only gets loaded once, and then everything else is updated via AJAX. > Of course. Because you are not allowing any new messages to be > processed. True, but as I pointed out I did try to use Application->ProcessMessages() without having much improvement. I think the event you mentioned above will work fine. Thanks! -Tom
Technical Details
Message-ID:
<45be9aed$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.google.com!news.maxwell.syr.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<45bdf8f5$1@newsgroups.borland.com> <45be40e9$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,d1b56cd84b3a485d X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Tom" <tom@nospam.net> Newsgroups: borland.public.cppbuilder.internet.socket References: <45bdf8f5$1@newsgroups.borland.com> <45be40e9$1@newsgroups.borland.com> Subject: Re: How to properly wait for TCPPWebbrowser to be ready... Date: Mon, 29 Jan 2007 19:11:09 -0600 Lines: 43 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: <45be9aed$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1170119405 68.1.78.156 (29 Jan 2007 17:10:05 -0800) Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.google.com!news.maxwell.syr.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail