← Symantec C++ Programming for the Macintosh, Second Edition

Symantec C++ Programming for the Macintosh, Second Edition

From the originals

13 scans

Machine-transcribed text and image descriptions. Check the linked original for uncertain words or fine print.

These are transcribed pages from the documents, not the full publications. Open the original for the remaining pages.

Image 1

SAMS PUBLISHING SYMANTEC. OFFICIAL GUIDE Covers all versions through 6.5! Disk Included! Symantec C++ Programming for Macintosh® 2nd Edition Neil Rhodes & Julie McKeehan

A yellow book cover with a cartoon illustration of a crane lifting an arch block above a cluster of buildings, a red banner reading 'Covers all versions through 6.5!', a red floppy disk icon, and large black and red title lettering.

Reading notes: The '2nd Edition' edition label is printed in a serif font at the bottom left and is not clearly a headline; the Symantec logo block and 'OFFICIAL GUIDE' text are set in separate boxes that may be read in a different order.

Printed product names
Symantec C++
Printed dates
2nd Edition
Languages
English
PDF page 1

SAMS PUBLISHING SYMANTEC. OFFICIAL GUIDE Covers all versions through 6.5! Disk Included! Symantec C++ P ~ramming for Macintosh® 2nd Edition Neil Rhodes & Julie McKeehan

Reading notes: Headline choice is inferred from the title block; the supplied copy does not mark which line is the primary headline. The supplied text shows 'P ~ramming', which appears to be a garbled rendering of 'Programming' and should be checked against the image. '6.5!' refers to a software version number, not a printed date, so it is excluded from printedDates. Reading order of the publisher, series and title lines is uncertain.

Printed product names
Symantec C++
Languages
English
PDF page 2

Symantec C++ Programming for the Macintosh

SAMS PUBLISHING Symantec C++ Programming for the Macintosh Second Edition

A dark book cover with a large bold gray-outlined title stacked in four lines, a repeated faded title echo behind it, a Sams Publishing logo at top left, and a large Pac-Man-like pie shape at the lower right holding the italic text 'Second Edition'.

Reading notes: Title words are set in a stylized outlined display font; the faded background repetitions of the title are not transcribed as separate text. The 'Second Edition' text sits over the pie shape and is read from its white italic letters.

Languages
English
PDF page 3

Symantec C++ Programming tor the Macintosh 2nd Edition Neil Rhodes Julie McKeehan Revised by Tom Chavez SAMS PUBLISHING

Printed product names
Symantec C++
Printed dates
2nd Edition
Languages
English
PDF page 4

I IV Copyright ©1994 by Sams Publishing All rights reserved, including the right of reproduction in whole or in part in any form. Sams Publishing A Division of Macmillan Computer Publishing 201 West 103rd Street Indianapolis, Indiana 46290 ISBN: 1-56686-155-1 Library of Congress Catalog No.: 94-070444 Printing Code: The rightmost double-digit number is the year of the book's printing; the rightmost single-digit number is the number of the book's printing. For example, 94-1 shows that the first printing of the book occurred in 1994. 97 96 95 94 4 3 2 1 Manufactured in the United States of America Limits of Liability and Disclaimer of Warranty: The author and publisher of this book have used their best efforts in preparing this book and the programs contained in it. These efforts include the development, research, and testing of the theories and programs to determine their effectiveness. The author and publisher make no warranty of any kind, expressed or implied, with regard to these programs or the documentation contained in this book. The author and publisher shall not be liable in any event for incidental or consequential damages in connection with, or arising out of, the furnishing, performance, or use of these programs. Trademarks: Most computer and software brand names have trademarks or registered trademarks. The individual trademarks have not been listed here. Svmantec C++ tor the Macintosh, 2nd Edition

Reading notes: Product title line 'Svmantec C++ for the Macintosh' contains a likely OCR misreading of 'Symantec' and spacing irregularities. ISBN and catalog number printed dates are identifiers rather than publication dates; treat with caution.

Printed dates
1994 · 94-070444 · 1-56686-155-1
Languages
English
PDF page 5

About the Authors Neil Rhodes is an expert programmer and popular lecturer at MacWorld, MADA, and Apple Worldwide Developer's conferences. He is a founder of Calliope Enterprises, which creates innovative tools for Macintosh devel- opment and provides consulting services to developers. Julie McKeehan is a Macintosh software developer and technical writer, as well as principal of Calliope Enterprises. She brings her years of experience directing product development and writing software manuals to this book. Tom Chavez is a product manager with Taligent, Inc., the joint venture of IBM, Apple, and Hewlett Packard. He was formerly with Apple Com- puter for over four years, most recently as product manager for MacApp. Tom lives in California and enjoys traveling to and scuba diving in exotic locations around the world. v svmantec C++ tor the Macintosh, 2nd Edition

Reading notes: Running header 'v svmantec C++ tor the Macintosh, 2nd Edition' appears garbled; likely 'Symantec C++ for the Macintosh, 2nd Edition' with damaged characters.

Printed product names
MacApp
Languages
English
PDF page 6

Credits ' Vl Publisher Rick Ranucci Managing Editor Kelly D. Dobbs Developmental Editor Sunthar Visuvalingam Production Editor Howard Jones Copy Editor Jo Anna Arnott Book Designer Kevin Spear Cover Designer Jay Corpus Imprint Manager Scott Cook srmanlac C++ tor Iha Macintosh, 2nd Edition Product Markellng Manager Debra Kempker Production AnalVSIS Dennis Clay Hager Mary Beth Wakefield Indexer Jeanne Clark Production Team Gary Adair Brad Chinn Kim Cofer Meshell Dinn Mark Enochs Stephanie Gregory Angela P. Judy Jenny Kucera Stephanie McComb Shelly Palma Beth Rago Bobbi Satterfield Marc Sheeter Kris Simmons Greg Simsic Carol Stamile Robert Wolf

Reading notes: Title line 'C++ for the Macintosh, 2nd Edition' has spacing and character irregularities (e.g., 'srmanlac', 'Iha', 'tor') that may be OCR artifacts

Languages
English
PDF page 7

Acknowledgments This book is the product of many people's labors besides our own and they deserve recognition for their contributions. Our thanks to our editors at Brady for all their work on this book under a tight deadline. Gratitude as well to Carole Mcclendon, our agent at Waterside Productions for her many efforts on our behalf. We owe a special debt of gratitude to Dave Wilson for his willingness to contribute programming time to this book. Dave is not only a fine teacher but a good friend as well. As the original impulse behind Neil's getting into the programmer training business, he can't be thanked enough. Thanks to all of our students, but most particularly to Neil's students at Apple Developer University. No teacher could ask for a better, brighter bunch to learn from. In the more general realm, we would also like to thank Apple Computer for producing the PowerBooks on which this entire book was written. We can hardly wait to see what they will cook up next. Thanks also to Joel West for getting us into the Macintosh software business and for beingthe impetus behind our striking out on our own. Last, but not least, our heartfelt gratitude goes to Loring and Barbie Fiske- Phillips. It is only because of their generosity and unceasing labors on our behalf that this book was finished on time. No one could ask for better friends. Neil Rhodes Julie McKeehan April1994 I I Vll Symantec C++ lor lhe Macintosh, 2nd Edition

Reading notes: Running header 'Vll Symantec C++ lor the Macintosh, 2nd Edition' has OCR-damaged characters ('Vll', 'lor', 'lhe').

Languages
English
PDF page 8

Dedication To my mother, Mary, who taught me to always take a book wherever I go. Books have provided a lifetime of reward, as has she. Neil Rhodes To my parents, Gloria and Richard McKeehan, who taught me to finish what I start, even if it's harder than I thought. And, to my best friend, Barbie, who mothered my children, fed my dogs, and did a thousand things without hesitation to ensure I would have a life to come back to. Julie McKeehan • IX Symantec C++ for the Macintosh, 2nd Edition

Reading notes: Edition label reads '2nd Edition' with a preceding 'IX' marker; the 'IX' may be a page or section numeral rather than part of the product name.

Printed product names
Symantec C++ for the Macintosh
Languages
English
PDF page 9

Contents at a Glance

Contents at a Glance Introduction .................................................................................... xxvii Part 1 The Symantec C++ Environment .............................................. 1 1 Creating a Project .............................................................................. 3 2 A Multiple-File Project ..................................................................... 21 3 Interpreting Error Messages ............................................................ 49 4 Debugging a Program ...................................................................... 59 5 Using Resource Utilities .................................................................. 83 6 Building an Application .................................................................. 95 7 Using Precompiled Headers ......................... :................................ 105 Part 2 The Elements of C++ .............................................................. 119 8 C++: An Enhanced C ..................................................................... 121 9 An Introduction to Object-Oriented Design ................................. 167 10 Getting Started with Objects ......................................................... 185 11 A Closer Look at Objects ............................................................... 213 12 Writing Effective C++ Code .......................................................... 235 13 The THINK Class Browser ............................................................. 249 14 The C++ Options Panels ................................................................ 261 Part 3 The THINK ClassLibrary and Other Frameworks ............... 309 15 Using a Framework ........................................................................ 311 16 RandomRectangle: Building a Rectangle Display Program .......... 323 17 TextTyper: Building a Text-Editing Program ................................ 339 18 Exception Handling and Templates: PICTPeeker ......................... 357 19 Tick-Tock: Building a Clock Application ...................................... 383 20 C++ Cale: Building a Calculator .................................................... 405 21 Using Visual Architect: AddressBook ............................................ 433 A Compatibility and Porting ............................................................ 511 B SourceServer and ToolServer ......................................................... 519 C TCL Reference ............................................................................... 541 D Complete Source Listings .............................................................. 5 71 E Annotated Bibliography ................................................................ 717 F Disk Contents ................................................................................ 723 Index .................................................................................................. 733 x srmantac C++ tor Iba Macintosh, 2nd Edition

Reading notes: Garbled OCR characters in some entries (e.g., ' :....') and 'srmantac' / 'tor Iba' in the footer may be misreads of 'Symantec' and 'for the'.

Languages
English
PDF page 10

Contents Part 1 The Symantec C++ Environment .............................................. 1 1 Creating a Project .............................................................................. 3 The Symantec C++ Folders ................................................................ 4 Installing Symantec C++ ................................................................... 7 Creating a New Project ...................................................................... 7 Modifying a Source File ................................................................... 10 Running the Program ...................................................................... 11 Errors in a Project ............................................................................ 13 Compile Errors ........................................................................ 13 Link Errors .............................................................................. 14 Avoiding Dialogs ............................................................................. 16 Avoiding the Project Update Dialog ...................................... 16 Avoiding the Save Changes Dialog ........................................ 17 Project-Building Shortcuts .............................................................. 18 Summary ......................................................................................... 19 2 A Multiple-File Project ..................................................................... 21 Adding Files to a Project .................................................................. 22 Adding a Single Source File to the Project ............................. 25 Adding Libraries or Multiple Files to the Project ................... 26 The Add Files Dialog ............................................................... 27 Source Files in the Project Window ....................................... 29 Adding Include Files ........................................................................ 31 Compiling a Single File ................................................................... 32 Checking for Syntax Errors ............................................................. 33 Removing Objects ........................................................................... 35 Searching through Multiple Files .................................................... 36 One-at-a-Time Searches .......................................................... 38 Batch Searches ........................................................................ 39 Segmenting Your Program .............................................................. 39 Using Both C and C++ .................................................................... 41 File Extensions ................................................................................. 43 Summary ......................................................................................... 47 3 Interpreting Error Messages ............................................................ 49 An Error-Ridden Sample Program ................................................... 50 The Compile Errors of an Error-Ridden Program ........................... 52 Link Errors ....................................................................................... 53 Choosing the Number of Errors To Report ..................................... 55 • XI SJmanlac C++ tor Iba Maclnlasb, 2nd Edition

Reading notes: Final page number and short header line at bottom are partially illegible ("XI SJmanlac")

Printed product names
Symantec C++
Languages
English
PDF page 11

Getting Rid of Warnings ................................................................. 56 Establishing a Philosophy about Warnings ........................... 56 The Three Rules of Warning Elimination .............................. 5 7 Summary ......................................................................................... 58 4 Debugging a Program ...................................................................... 59 Turning On the Debugger ............................................................... 60 Starting Programs with the Debugger Activated .............................................................. 61 Command Options ......................................................................... 62 The Step Command ................................................................ 63 The Trace Command .............................................................. 65 The Out Command ................................................................ 67 The In Command ................................................................... 68 The Go Command .................................................................. 69 The Stop Command ............................................................... 69 Putting a Command in Automatic Mode .............................. 69 Showing the Call Chain .................................................................. 70 Examining Functions in the Source Window .................................................................... 71 Using Breakpoints ........................................................................... 72 Examining and Setting the Values of Variables ............................................................... 73 Using Debugger Statements in Programs ........................................ 76 Calling Functions from the THINK Debugger .................................................................. 77 Low-Level Debuggers ....................................................................... 80 Using Two Screens ........................................................................... 82 Summary ......................................................................................... 82 5 Using Resource Utilities .................................................................. 83 Writing a Program That Uses Resources ......................................... 84 Creating the Project ................................................................ 84 What the Program Does ......................................................... 87 Including Resources in the Program ............................................... 8 7 Creating Resources with ResEdit ............................................ 87 Adding Resources Directly ...................................................... 89 Creating Resources with THINK Rez ............................................... 90 Comparing THINK Rez with ResEdit .............................................. 92 THINK Rez Advantages ........................................................... 92 ResEdit Advantages ................................................................. 93 Summary ......................................................................................... 93 Exercise ............................................................................................ 93 •• Xll Symannac C++ tor Iha Macintosh, 2nd Edition

Reading notes: Table of contents text with page numbers; no primary heading identified Possible OCR spacing artifacts such as 'Symannac' and '5 7' in the source

Printed product names
THINK Debugger · THINK Rez · ResEdit
Languages
English