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.

The <strong>C++</strong>Builder IDE Explored: Projects and Forms<br />

Projects <strong>in</strong> <strong>C++</strong>Builder<br />

As you know by now, a lot goes on beh<strong>in</strong>d the scenes as you write a <strong>C++</strong>Builder application.<br />

In fact, more goes on than I have told you about up to this po<strong>in</strong>t. It’s not vital that you know<br />

every detail about what happens beh<strong>in</strong>d the scenes as you write a <strong>C++</strong>Builder application, but<br />

it is a good idea to have a general overview.<br />

A project is a collection of files that work together to create a standalone executable<br />

file or DLL.<br />

NEW TERM<br />

Files Used <strong>in</strong> <strong>C++</strong>Builder Projects<br />

<strong>C++</strong>Builder manages a project through the use of several support files. To illustrate, let’s<br />

create a simple application to get a look at some of what goes on when <strong>C++</strong>Builder builds an<br />

executable file for your program. Do the follow<strong>in</strong>g:<br />

1. Before you beg<strong>in</strong>, create a fresh directory on your hard drive.<br />

2. Now choose File | New Application from the ma<strong>in</strong> menu. A blank form is displayed.<br />

3. Before you do anyth<strong>in</strong>g else, choose File | Save Project from the ma<strong>in</strong> menu.<br />

4. First, you will be prompted for the name of the unit file. Be sure to switch to the<br />

empty directory you just created.<br />

5. Next, type <strong>in</strong> the name MyUnit for the unit filename and click OK.<br />

6. Now you are prompted for the project name. Type TEST <strong>in</strong> the File name field and<br />

click OK.<br />

7. Now choose Project | Build All from the ma<strong>in</strong> menu. <strong>C++</strong>Builder displays the<br />

compile status box and goes to work compil<strong>in</strong>g the program.<br />

8. After a while, the compile status box reports that it is done compil<strong>in</strong>g, and the OK<br />

button is enabled. Click OK to close the compile status dialog box<br />

9. Now choose Project | Close All from the ma<strong>in</strong> menu. (Yes, this exercise does have a<br />

purpose.)<br />

10. Now run W<strong>in</strong>dows Explorer and locate the directory where you saved the project.<br />

You should see a number of files.<br />

Wow! All that to create just one little program that does noth<strong>in</strong>g? Yep, it’s true. First, let me<br />

tell you what happens when <strong>C++</strong>Builder builds an application; then I’ll expla<strong>in</strong> what each<br />

of these files is for.<br />

169<br />

6

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

Saved successfully!

Ooh no, something went wrong!