Article View: borland.public.cppbuilder.internet.web
Article #29Re: Using TCppWebBrowser
From: Remy Lebeau (TeamB)
Date: Mon, 11 Feb 2008 18:01
Date: Mon, 11 Feb 2008 18:01
46 lines
2659 bytes
2659 bytes
"Mike K" <nospam@nospam.net> wrote in message
news:47af4a4e@newsgroups.borland.com...
> how can I launch a web browser and navigate it to a specific
> URL from within my CPPBuilder 5 application?
To launch the user's default browser, use ShellExecute(), ie:
#include <shellapi.h>
{
//...
ShellExecute(NULL, "open", "http://www.gohere.com", NULL, NULL,
SW_SHOWNORMAL);
//...
}
> I see TCppWebBrowser in the help system, but it's not on any
> component palette.
Then you likely are not using an edition of BCB that has that component
available. You can import Microsoft's IE ActiveX control into your project
manually, though.
> The application is, I know within my code the IP address and port
> number of a remote web server; I need to open a browser window
> pointed to the web server.
ShellExecute(NULL, "open", "http://TheIPHere:ThePortHere", NULL, NULL,
SW_SHOWNORMAL);
> I need to use a Borland component for the browser (instead of launching
> IE7) because I need access to the data that is retrieved from the server
> as well.
If you want the user to see the webpage, then TCppWebBrowser (or the
imported control, or a third-party web browser control) is the way to go.
But if all you want is to retreive the data without the user seeing the
webpage, then don't use a browser at all. Use an HTTP component/library,
such as the HTTP client in Indy (http://www.indyproject.org), ICS
(http://www.overbyte.be), or Synpase (http://www.ararat.cz/synapse), or use
Microsoft's WinInet or WinHTTP API, to retreive the data directly instead.
Gambit
Technical Details
Message-ID:
<47b08db7$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<47af4a4e@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,57d0b10d861f6a0e X-Google-Attributes: gidfeeec,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.web References: <47af4a4e@newsgroups.borland.com> Subject: Re: Using TCppWebBrowser Date: Mon, 11 Feb 2008 10:01:31 -0800 Lines: 48 Organization: Lebeau Software X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 NNTP-Posting-Host: 207.178.157.90 Message-ID: <47b08db7$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1202752951 207.178.157.90 (11 Feb 2008 10:02:31 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail