🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.multimedia
Article #852

Re: How do I load *.htm with CppWebBrowser ?

#852
From: Hans Galema
Date: Tue, 25 Feb 2003 14:39
37 lines
1949 bytes
The TCppWebBrowser wil always be in some directory.

If the .html file is in the same directory then
the path to the application is can be found using
ParamStr(0);

Lets say the application and the .html file are:

F:\MyDir\MySubDir\MyApplication.exe
F:\MyDir\MySubDir\index.html

AnsiString Path = ParamStr(0);

Now Path == F:\MyDir\MySubDir\MyApplication.exe;

AnsiString Dir = ExtractFilePath ( Path );

Dir is now F:\MyDir\MySubDir\

AnsiString FileName = Path + "index.html";

FileName is now F:\MyDir\MySubDir\index.html

You only have to make a function that changes this in

file:///F|/MyDir/MySubDir/index.html

maybe (untested)

file:///F|\MyDir\MySubDir\index.html

would work too.

Hans.

[wilkas] wrote:
> mhm, but what if i cary my work to other pc to some x:\xxx\xxx....\xxx\ dir?
Technical Details
Message-ID: <3e5b8038@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3e5b4953@newsgroups.borland.com> <3e5b5bd9@newsgroups.borland.com> <3e5b7cf0@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d0fc,216fded8599dc620
X-Google-Attributes: gid10d0fc,public
X-Google-ArrivalTime: 2003-02-25 06:44:03 PST
Date: Tue, 25 Feb 2003 15:39:58 +0100
From: Hans Galema <j.m.galema@maartens.nl>
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.2.1) Gecko/20021130
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.multimedia
Subject: Re: How do I load *.htm with CppWebBrowser ?
References: <3e5b4953@newsgroups.borland.com> <3e5b5bd9@newsgroups.borland.com> <3e5b7cf0@newsgroups.borland.com>
In-Reply-To: <3e5b7cf0@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 129.125.108.11
Message-ID: <3e5b8038@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1046183992 129.125.108.11 (25 Feb 2003 06:39:52 -0800)
Lines: 38
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail