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.

6<br />

170 Day 6<br />

NOTE<br />

Files with extensions that beg<strong>in</strong> with a tilde (~) are backup files.<br />

<strong>C++</strong>Builder may create several backup files, depend<strong>in</strong>g on the number<br />

of source files <strong>in</strong> the project and the project options you have set.<br />

Project options are discussed on Day 10, “More on Projects.”<br />

When you first create a project, <strong>C++</strong>Builder creates a m<strong>in</strong>imum of six files (assum<strong>in</strong>g a typical<br />

<strong>C++</strong>Builder GUI application):<br />

■ The project source file<br />

■ The ma<strong>in</strong> form source file<br />

■ The ma<strong>in</strong> form header file<br />

■ The ma<strong>in</strong> form resource file<br />

■ The application resource file<br />

■ The project makefile<br />

The project source file is the file that conta<strong>in</strong>s the W<strong>in</strong>Ma<strong>in</strong>() function and other <strong>C++</strong>Builder<br />

startup code. You can view the project source file by choos<strong>in</strong>g View | Project Source from the<br />

ma<strong>in</strong> menu. The ma<strong>in</strong> form source file and ma<strong>in</strong> form header file are files that conta<strong>in</strong> the class<br />

declaration and def<strong>in</strong>ition for the ma<strong>in</strong> form’s class. <strong>C++</strong>Builder will create an additional<br />

source file and header for each new form you create. The ma<strong>in</strong> form resource file and<br />

application resource file are b<strong>in</strong>ary files that describe the ma<strong>in</strong> form and the application’s icon.<br />

I’ll expla<strong>in</strong> that <strong>in</strong> more detail a little later, <strong>in</strong> the section titled “Dialog Boxes <strong>in</strong> Traditional<br />

W<strong>in</strong>dows Programs.”<br />

Somewhere <strong>in</strong> this process, <strong>C++</strong>Builder creates the project makefile. The makefile is a text file<br />

that conta<strong>in</strong>s <strong>in</strong>formation about the compiler options you have set, the names of the source<br />

files and forms that make up the project, and what library files have to be <strong>in</strong>cluded.<br />

NOTE<br />

There are two types of library files. A static library conta<strong>in</strong>s common<br />

code that an application needs <strong>in</strong> order to run. An import library is<br />

needed when your application references functions <strong>in</strong> a DLL, such as<br />

the W<strong>in</strong>dows API functions. The number and exact filenames of the<br />

library files required depend on the features your application uses.<br />

Fortunately, you don’t have to worry about manag<strong>in</strong>g the library files<br />

because <strong>C++</strong>Builder takes care of that detail for you. Library files have<br />

an .LIB extension and are tucked away <strong>in</strong> your <strong>C++</strong>Builder \lib<br />

directory.

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

Saved successfully!

Ooh no, something went wrong!