• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 302
  • Last Modified:

Twebbrowser questions

I have 2 questions about Twebbrowser:

1.Is there a bug on twebbrowser for the online and offline property? I'm trying to set the browser to work offline but i can't. The url is always loading even if i set the webbrowser offlne property to true. How can i set the webbrowser to work offline?

2. I've made a function that i want to start after the the document is fully loaded. I've put it on ondocumentcomplete event but the function is loaded too when thw url address is invalid. How can i start this function only when the page is fully completed and no url error is founded.
0
dia21
Asked:
dia21
  • 3
  • 3
1 Solution
 
smotCommented:
Hi,

Have a look at my Mini Webbrowser Demo:

http://www.crystalline.ch/downloads/MiniWebbrowserDemo.zip
0
 
Eddie ShipmanAll-around developerCommented:
Wow, smot, some of your code will help out in a project that I'm doing. Thanks.
AFA #2 is concerned, check the readystate of the browser:

  while (WebBrowser1.ReadyState <> READYSTATE_COMPLETE) then
    Application.ProcessMEssages;

0
 
dia21Author Commented:
Thank you smot for the code but i have small pb while trying to use in my program. When trying to navigate an url while  is in online mode i can't view any page because always i get that dns error and when is in offline mode the page is loaded(if i loaded prior with your Mini Webbrowser Demo) but i can't see the images on the page. Do i have to set something else?

EddieShipman As for Q2 i already using that i want to launch the function only if the webpage is fully completed and if the url exists. If i use nly this code it will launch the function every time even if the url is incorect.


Thanks
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Eddie ShipmanAll-around developerCommented:
Then you must check the resultcode of the web page to see if it is not
an error result.
0
 
dia21Author Commented:
and how can i check resultcode?
0
 
Eddie ShipmanAll-around developerCommented:
Unless you know that the user is using IE6, there is no way. With IE6, you have a new event called OnNavigate.
What you have to do, though is import the IE6 TypeLib (SHDocVw.DLL) and replace the one that came with Delphi.

Here's documentation on the event:
http://msdn.microsoft.com/workshop/browser/webbrowser/reference/events/navigateerror.asp
0
 
dia21Author Commented:
thank you for the comments
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now