🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #9215

URL Offsets Prevent URLs from being passed to a browser

#9215
From: Randall Parker
Date: Mon, 26 Jul 2004 04:50
21 lines
1695 bytes
Suppose I have

    AnsiString UrlStr = "file://" + ExtractFilePath(Application->ExeName) + "myfile.htm";
    ShellExecute(NULL,"open",UrlStr.c_str(),0,0,SW_SHOWDEFAULT);

That works. But if I have:

    AnsiString UrlStr = "file://" + ExtractFilePath(Application->ExeName) + 
"myfile.htm#HotKeys";
    ShellExecute(NULL,"open",UrlStr.c_str(),0,0,SW_SHOWDEFAULT);

or:

    AnsiString UrlStr = "file://" + ExtractFilePath(Application->ExeName) + 
"myfile.htm%23HotKeys";
    ShellExecute(NULL,"open",UrlStr.c_str(),0,0,SW_SHOWDEFAULT);

then the browser (Mozilla FireFox) doesn't get invoked.

I suspect the #Hotkeys or the %23HotKeys is preventing the file from being recognized 
as appropriate for a browser. How to route the shell execution call to the browser?
Technical Details
Message-ID: <41048d77$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,80cfdee9a8d50af3,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Sun, 25 Jul 2004 21:50:13 -0700
From: Randall Parker <STOPtechiepundit@EVILfuturePOXpunditSPAM.com>
User-Agent: Mozilla Thunderbird 0.7 (Windows/20040616)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: URL Offsets Prevent URLs from being passed to a browser
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 4.40.49.194
Message-ID: <41048d77$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1090817399 4.40.49.194 (25 Jul 2004 21:49:59 -0700)
Lines: 21
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail