|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Problem with TWebBrowser Control and Threads
I am just new to Delphi Programmng and am having a problem with the TWebBrowser Control,
I have some code like this WebBrowser1.Navigate('(some other url)); while Form1.WebBrowser1.Busy do Application.ProcessMessages; ; Do Some Stuff Here... WebBrowser1.Navigate(some other url)); while Form1.WebBrowser1.Busy do Application.ProcessMessages; ; Do some more stuff here. The problem is, it seems is that the WebBrowser Control seems to navigate to the first url as it is meant to, and then before first page has fully loaded and the code right after the WebBrowser1.Navigate is executed before the page has finished loading Or it does not even get executed at all, and rather Navigates to the second URL and processes the second block of code. Is this because the webrowser.navigate method causes a seperate thread to execute and program execution continues in the main thead before the webbrowser has finished downloading the page ? It's confusing me a little bit ![]() Thanks. and |
|
#2
|
|||
|
|||
|
It's just a guess but I would say that removing the
Application.Processmessages; Might stop it from jumping from one to another. Either that or you need some sort of control, probably a boolean variable to prevent the second process from working until the first has finished. Something like.. WebBrowser1.Navigate('(some other url)); while Form1.WebBrowser1.Busy do begin Process1Busy:=True; Application.ProcessMessages; end; Process1Busy:=False; ; Do Some Stuff Here... if Process1Busy=False then WebBrowser1.Navigate(some other url)); while Form1.WebBrowser1.Busy do Application.ProcessMessages; ; Do some more stuff here. |
|
#3
|
|||
|
|||
|
Problem with IWebBrowser
Thanks, i will give that a try
Quote:
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Delphi Programming > Problem with TWebBrowser Control and Threads |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|