-1

I did already some google research on this subject like here stackoverflow but did not find the correct answer for my problem. My application is running fine on some client PC's but not on all systems we would like to use our tool.

I guess my code for loading a HTML file into the web browser is also fine for most conditions :

MyWebBrowser.Navigate('about:blank');
MyWebBrowser.Navigate('file://' + Filename);
while MyWebBrowser.ReadyState <> READYSTATE_COMPLETE do
  application.ProcessMessages;

but there must be some condition on these problems PC where it leads to the freezing of my application while trying to navigate to my HTML file.

I guess an answer solving my problem will check something on my IE settings and adjust these params before loading the file but here I #m running out of knowledge.

Community
  • 1
  • 1
user1769184
  • 1,571
  • 1
  • 19
  • 44

1 Answers1

4

When navigating the browser control never assume the call finishes synchronously. Always use the OnNavigateComplete2 event, even if you're navigating to 'about:blank' which should be relatively fast.

Using the event, you can also avoid the ugly busy loop with Application.ProcessMessages (and spare yourself more trouble due to the re-entrancy requirement it places on your methods).

Ondrej Kelle
  • 36,941
  • 2
  • 65
  • 128
  • I use Win 7 x 64 ; inside the DELPHi IDE my application crashes; running the *.exe directly my HTML is displayed in the TWebbrowser – user1769184 Aug 13 '16 at 13:26