Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to program web access 1

Status
Not open for further replies.

ClaudeWSmith

Programmer
Aug 24, 2009
13
0
0
I have a very simple question.

How to program an application to access the web.

What I want to do is be able to press a button and have the application call my web browser to access a particular web page.

I am using Borland C++ Builder version 5 (Build 12.34 )

Thanks
 
Could you embed a browser in your application to show the web page?
 
Of course, I could make a system call... like

system( "C:\Program Files\Firefox\Firefox.exe -url URL" );

But, would want something more slick and not so absolute location dependent.

Claude
 
In Windows the default web browser will be configured to automatically handle calls to access web pages. In your program, all you have to do is call the ShellExecute() API:

Code:
ShellExecute(NULL, "open", "[URL unfurl="true"]http://www.tek-tips.com",[/URL] "", NULL, SW_RESTORE);

Jeff
_______________________________________
SourceSafe Help | ClearQuest Help | PC Hardware
 
ClaudeWSmith,

Does Builder version 5 have a TCPPWebBrowser component or a (???) (the name of the other web browser component is escaping me). I haven't used version 5 in years, so I can't remember what was available. If it does, you can drop a TCppWebBrowser component on your form and directly feed it web site addresses in code.

Steve.
 
Jeff; Thanks - That works-

Where to get a list of all the API commands is my next quest.

Claude
 
Interesting: The ShellExecute command works in Ver 5 but I don't have any documentation as to parameters, etc.

Claude
 
The ShellExecute command works in Ver 5 but I don't have any documentation as to parameters, etc.

Look at the FAQ in this forum.


James P. Cottingham
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
You can use ActionList where the most of the ShellExecute commands are gathered. In version 5 there is no TAction for the browser. But in BCB2006 you have TBrowserURL, TDownloadURL and TSendMail under the standard Actions/Internet. It is as if you use the ShellExecute() command.

On my BCB5, there is a lot about Win API, under MS SDK Help files. It is for me the main reason why BCB5 is still installed on one of my computers. But you can find the same and now more actual on the Microsoft Website, which is now available for everyone since a couple of years.
 
Hi

If it is available then use the NMHTTP component on the FastNet tab.

NMHTTP1->Get ( "address of web page ");
AnsString Response = NMHTTP1->Body;

Response contains the html of the web page.

useful if you are wanting to process the page as oppose to just display it.

Hope this helps!

Regards

BuilderSpec
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top