12.12.2012 Views

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Build<strong>in</strong>g Internet Applications<br />

Table 13.1. <strong>C++</strong>Builder’s Internet components and their respective<br />

functions.<br />

Component Description<br />

FTP Supports exchang<strong>in</strong>g files with remote mach<strong>in</strong>es<br />

THTML Supports pars<strong>in</strong>g and layout of HTML data and provides a<br />

scrollable view of the current HTML page<br />

THTTP Provides access to the Hypertext Transfer Protocol<br />

TNTTP Provides the ability to read and post to newsgroups<br />

TPOP Provides access to the POP3 electronic mail protocol<br />

TSMTP Supports send<strong>in</strong>g Internet mail messages to SMTP servers<br />

TTCP Provides access to the W<strong>in</strong>Sock Transfer Control Protocol<br />

(both client and server side)<br />

TUDP Provides access to the W<strong>in</strong>Sock User Datagram Protocol (both<br />

client and server)<br />

Some of these components provide access to popular Internet elements with which you’re<br />

probably familiar. For example, if you were go<strong>in</strong>g to build an FTP utility, you would use the<br />

FTP component. If you were build<strong>in</strong>g a newsreader, you’d use the NTTP component. If you<br />

were construct<strong>in</strong>g a Web browser (as we are today), you’d make use of the THTML control. If<br />

you wanted to send mail over the Internet, you might make use of the POP or SMTP component.<br />

This bevy of high-level controls makes much of the W<strong>in</strong>Sock cod<strong>in</strong>g of yesteryear obsolete<br />

and makes develop<strong>in</strong>g sophisticated Internet-related applications a snap.<br />

Build<strong>in</strong>g Your Web Browser<br />

Now that I’ve <strong>in</strong>troduced you to <strong>C++</strong>Builder’s Internet components, let’s build a simple Web<br />

browser. It’s not like the world really needs yet another Web browser; the purpose of this<br />

exercise is to demonstrate how easy it is to put together Internet apps that would have been<br />

major undertak<strong>in</strong>gs just a couple of years ago. <strong>C++</strong>Builder’s component-based approach to<br />

development allows you to concentrate on what you want to do rather than on how to do it.<br />

Let’s beg<strong>in</strong> by start<strong>in</strong>g a new project <strong>in</strong> <strong>C++</strong>Builder. Choose File | New Application from the<br />

<strong>C++</strong>Builder menu system to <strong>in</strong>itialize a new application project. When the new project is<br />

started, you’ll be presented with a new, blank form on which you can drop components. This<br />

form will be your Web browser. Set its Caption property to Surf and its Position property<br />

to poScreenCenter. Before you proceed, go ahead and save the new application as Surf.CPP<br />

and its associated form as Surf00.CPP. I suggest you use these similar yet different filenames<br />

475<br />

13

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!