🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.web
2 messages
2 total messages Started by Mike K Sun, 10 Feb 2008 19:02
Using TCppWebBrowser
#28
Author: Mike K
Date: Sun, 10 Feb 2008 19:02
15 lines
1423 bytes
Newbie question: how can I launch a web browser and navigate it to a 
specific URL from within my CPPBuilder 5 application?

I see TCppWebBrowser in the help system, but it's not on any component 
palette.

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.  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.

TIA

Mike
Re: Using TCppWebBrowser
#29
Author: Remy Lebeau (TeamB)
Date: Mon, 11 Feb 2008 18:01
46 lines
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 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads