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.

Creat<strong>in</strong>g Applications <strong>in</strong> <strong>C++</strong>Builder<br />

5. Where do you place the function def<strong>in</strong>ition (the function itself ) when you add<br />

your own functions to <strong>C++</strong>Builder code?<br />

6. How can you determ<strong>in</strong>e who wrote a particular object <strong>in</strong> the Object Repository?<br />

7. Where do you add and delete pages <strong>in</strong> the Object Repository?<br />

8. Is it easier to create a basic application from scratch or by us<strong>in</strong>g the Application<br />

Wizard?<br />

9. What are the two ways you can add a resource file to your project?<br />

10. Can you create a resource script file conta<strong>in</strong><strong>in</strong>g a str<strong>in</strong>g table with a text editor?<br />

Exercises<br />

1. Create a new form. Add several components of your choos<strong>in</strong>g to the form. Save the<br />

form to the Forms page of the Object Repository with the name BaseForm.<br />

2. Start a new application. Choose File | New to view the Object Repository. Switch<br />

to the Forms page. Click the Inherit radio button. Choose the BaseForm object you<br />

created <strong>in</strong> exercise 1 and add it to the application. (Be sure you used the Inherit<br />

option.) Save the project and close it.<br />

3. Open the BaseForm object you created <strong>in</strong> exercise 1. Delete all components on the<br />

form and save the form.<br />

4. Reopen the project you created <strong>in</strong> exercise 2. Display the new form you created <strong>in</strong><br />

that exercise. Note that the components are all gone. (Remember, you <strong>in</strong>herited<br />

this object, so all changes made to the base form were also made to the <strong>in</strong>herited<br />

form.)<br />

5. Choose Options | Repository from the ma<strong>in</strong> menu. Delete the BaseForm created<br />

earlier.<br />

6. Create a project us<strong>in</strong>g the Application Wizard. Use all menu options and make the<br />

application an MDI application. Create a speedbar for the application.<br />

7. Add a multipage dialog box to the application you created <strong>in</strong> exercise 6. Use the<br />

Dialog Wizard.<br />

8. Use the Object Repository to add an About box to the program you created <strong>in</strong><br />

exercise 6.<br />

9. Create a str<strong>in</strong>g table resource with a text editor and compile it with the resource<br />

compiler (BRCC32.EXE). Extra Credit: Write a program to load the str<strong>in</strong>gs and<br />

display them on a form.<br />

10. Us<strong>in</strong>g a text editor, open the JJRes.rc file from http://www.mcp.com/sams/<br />

codecenter.html and exam<strong>in</strong>e its contents.<br />

11. Write “I will not borrow bitmaps from other programs.” 100 times on the blackboard.<br />

351<br />

9

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

Saved successfully!

Ooh no, something went wrong!