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

2<strong>14</strong> Day 6<br />

Q&A<br />

Q The <strong>C++</strong>Builder toolbar doesn’t have buttons for the features I use most often.<br />

Can I change the toolbar?<br />

A Absolutely. The toolbar is fully customizable. You can add or remove buttons as<br />

you see fit.<br />

Q I placed multiple Label components on a form and then attempted to select<br />

them all by dragg<strong>in</strong>g. Instead I just got another big Label component. What<br />

have I done wrong?<br />

A You forgot to turn off the multiple placement option. After plac<strong>in</strong>g multiple<br />

components on the form, you need to click the arrow button on the Component<br />

Palette to turn off the multiple placement option.<br />

Q I have several components on a panel. I’m try<strong>in</strong>g to select the components by<br />

dragg<strong>in</strong>g, but I keep mov<strong>in</strong>g the panel <strong>in</strong>stead. What must I do to select a<br />

group of components on a panel?<br />

A Either use Shift+click to select each component or hold down the Ctrl key and drag<br />

a bound<strong>in</strong>g rectangle around the components.<br />

Q Can I write, compile, and run a simple <strong>C++</strong> program without a project?<br />

A No. In order to create an executable file, you need a project. The project makes<br />

sure that all needed library rout<strong>in</strong>es are l<strong>in</strong>ked to the f<strong>in</strong>al executable.<br />

Q What are library files for?<br />

A There is a common set of rout<strong>in</strong>es used <strong>in</strong> <strong>C++</strong> programs. The str<strong>in</strong>g manipulation<br />

functions I discussed on Day 1, “Gett<strong>in</strong>g Your Feet Wet,” are examples of such<br />

rout<strong>in</strong>es. If your program calls a <strong>C++</strong> function, that function must be <strong>in</strong>cluded <strong>in</strong><br />

the executable file for your program. These functions are conta<strong>in</strong>ed <strong>in</strong> a library file<br />

(.LIB). The l<strong>in</strong>ker makes a copy of the function found <strong>in</strong> the library file and places<br />

it <strong>in</strong> your executable. Any VCL methods your program calls are handled <strong>in</strong> the<br />

same way.<br />

Q Why does <strong>C++</strong>Builder use the term unit to refer to a source file?<br />

A <strong>C++</strong>Builder uses the term unit because <strong>C++</strong>Builder was created from <strong>Borland</strong>’s<br />

Delphi. Delphi is based on Pascal, and unit is a Pascal term for a source file.<br />

Q What do I need to do <strong>in</strong> order for my application to be an MDI application?<br />

A Just be sure that the ma<strong>in</strong> form has a FormStyle of fsMDIForm and that any MDI<br />

child forms have a FormStyle of fsMDIChild.

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

Saved successfully!

Ooh no, something went wrong!