#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    7
    Rep Power
    0

    Help Displaying an HTML file with Delphi


    I intended to post this in the HTML section. I don't know how it got here unless someone moved it here.

    But, if any admin could move it to the appropriate HTML seciont of this forum, I would very much appreciate it.

    Hello. This is my first post.

    I have been using Delphi for several years but I am not really very expert. I do have Delphi v7.2 and I would like to display some info I have taken from an HTML file.

    Actually, I accessed a web site on the net and then saved the page as an ".HTM" file. The page is very basic.

    I would like to be able to write a Delphi app that takes some or all of the data from an ".HTM" file and displays it on the screen and then interacts with the user and then blank the screen and display some other ".HTM" file.

    Is there any simple way to do this? I have read some info from one site but it was extremely complicated and I couldn't get it to work.

    Part of the problem was that I had to use a THTMLViewer component and I just couldn't find a way to make it work. The compiler kept telling me that it could not find some simple ".DCU" files - such as "variants.dcu".

    Can anyone show me a simple working example that just reads a file containing an ".HTM" file and displays it in a Delphi app?

    I anticipate that my app will not be run over the Internet. It is something that a single user will run in a "standalone" mode.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2006
    Location
    Carlsbad, CA
    Posts
    2,057
    Rep Power
    383
    variants.dcu is part of Delphi. You need to find out why it is either missing from your install or not on a path the compiler can find.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    7
    Rep Power
    0
    Originally Posted by clivew
    variants.dcu is part of Delphi. You need to find out why it is either missing from your install or not on a path the compiler can find.
    Yes. That makes sense. My Delphi V4.0 compiler is set up to use the path for that includes the

    C:\PROGRAM FILES (X86)\BORLAND\DELPHI4\LIB\

    I guess I have to point it to the Delphi v7.2 library.

    I'll try that and let you know.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    156
    Rep Power
    3
    If you have Delphi 7.2, why do you still use Delphi 4? I am not sure if D4 has Variants unit. You should check THTMLViewer documentation to see which Delphi versions it supports. Versions older than these usually require some adjustment. Some even won't be able to support THTMLViewer.

    On the topic, why don't you just use TWebBrowser? It's wrapper to IE, so it definitely will be able to render your .html files. You can capture user clicks by handling the OnBeforeNavigate event, then do adjustment as in redirect to correct url or load correct .html file.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    7
    Rep Power
    0
    Originally Posted by Luthfi
    If you have Delphi 7.2, why do you still use Delphi 4? I am not sure if D4 has Variants unit. You should check THTMLViewer documentation to see which Delphi versions it supports. Versions older than these usually require some adjustment. Some even won't be able to support THTMLViewer.

    On the topic, why don't you just use TWebBrowser? It's wrapper to IE, so it definitely will be able to render your .html files. You can capture user clicks by handling the OnBeforeNavigate event, then do adjustment as in redirect to correct url or load correct .html file.
    Thank you very much. I have gotten this working now using TWebBrowser as you suggest.

IMN logo majestic logo threadwatch logo seochat tools logo