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.

164 Day 5<br />

Quiz<br />

Q It seems like the component way of do<strong>in</strong>g th<strong>in</strong>gs is the best approach. Is that<br />

true?<br />

A It is true for many applications, but certa<strong>in</strong>ly not for all. In some cases a framework<br />

such as OWL or MFC will be better suited to the task. For applications that use a<br />

lot of dialog boxes and w<strong>in</strong>dows, and for database applications, VCL is probably a<br />

very good choice. Overall, <strong>C++</strong>Builder is much easier to learn and easier to use<br />

than the <strong>C++</strong> class libraries.<br />

Q Are properties just class data members?<br />

A No. Properties are special creatures. Some properties simply set a data member <strong>in</strong><br />

the class. Other properties, when modified, <strong>in</strong>voke a method that performs special<br />

operations with that property. In these cases, a property does more than just set a<br />

data member.<br />

Q Do I have to respond to each and every event a component def<strong>in</strong>es?<br />

A No. You can respond to as many events as is appropriate for your application, or<br />

not respond to any events at all.<br />

Q There sure are a lot of VCL classes. I thought programm<strong>in</strong>g with <strong>C++</strong>Builder<br />

was go<strong>in</strong>g to be easy.<br />

A Programm<strong>in</strong>g with <strong>C++</strong>Builder is much easier than programm<strong>in</strong>g W<strong>in</strong>dows <strong>in</strong> C,<br />

and easier than programm<strong>in</strong>g with a <strong>C++</strong> framework like OWL or MFC. W<strong>in</strong>dows<br />

programm<strong>in</strong>g, no matter how good the programm<strong>in</strong>g tool, requires a lot of<br />

experience and knowledge to master. Over time, you will master it if you keep at it.<br />

Q Can I use <strong>C++</strong>Builder forms <strong>in</strong> my OWL and MFC programs?<br />

A Yes. Later <strong>in</strong> the book I’ll show you how you can do that.<br />

1. Are all components visible at design time and runtime?<br />

2. Which is better—OWL, MFC, or VCL?<br />

3. Can VCL objects be allocated locally (from the stack) as well as dynamically?<br />

4. Are methods <strong>in</strong> VCL components equivalent to functions <strong>in</strong> <strong>C++</strong>?<br />

5. Are all VCL classes ultimately derived from TObject?<br />

6. Name one nonvisual VCL component.<br />

7. Do all components share certa<strong>in</strong> common properties?<br />

8. Name two common properties that all visual components share.<br />

9. Can two or more components share the same event-handl<strong>in</strong>g function?<br />

10. What is the VCL term<strong>in</strong>ology for a W<strong>in</strong>dows device context? What is the name of<br />

the VCL class that encapsulates device contexts?

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

Saved successfully!

Ooh no, something went wrong!