Board index » cppbuilder » How to properly wait for TCPPWebbrowser to be ready...
Tom
![]() CBuilder Developer |
How to properly wait for TCPPWebbrowser to be ready...2007-01-29 09:40:03 PM cppbuilder1 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 |