Ivor Horton’s
Beginning
Visual C++
®
2008
Ivor Horton
25905ffirs.qxd:WroxPro 2/21/08 8:27 AM Page iii
Ivor Horton’s
Beginning
Visual C++
®
2008
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv
Chapter 1: Programming with Visual C++ 2008 . . . . . . . . . . . . . . . . . . . . . . . 1
Chapter 2: Data, Variables, and Calculations. . . . . . . . . . . . . . . . . . . . . . . . . 35
Chapter 3: Decisions and Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Chapter 4: Arrays, Strings, and Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Chapter 5: Introducing Structure into Your Programs . . . . . . . . . . . . . . . . . 239
Chapter 6: More about Program Structure . . . . . . . . . . . . . . . . . . . . . . . . . 279
Chapter 7: Defining Your Own Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . 331
Chapter 8: More on Classes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Chapter 9: Class Inheritance and Virtual Functions. . . . . . . . . . . . . . . . . . . 507
Chapter 10: The Standard Template Library . . . . . . . . . . . . . . . . . . . . . . . . 601
Chapter 11: Debugging Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
Chapter 12: Windows Programming Concepts . . . . . . . . . . . . . . . . . . . . . . 743
Chapter 13: Windows Programming with the Microsoft Foundation Classes . . 779
Chapter 14: Working with Menus and Toolbars . . . . . . . . . . . . . . . . . . . . . . 805
Chapter 15: Drawing in a Window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847
Chapter 16: Creating the Document and Improving the View . . . . . . . . . . . . 909
Chapter 17: Working with Dialogs and Controls . . . . . . . . . . . . . . . . . . . . . 985
Chapter 18: Storing and Printing Documents . . . . . . . . . . . . . . . . . . . . . . 1047
Chapter 19: Writing Your Own DLLs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1093
Chapter 20: Connecting to Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . 1113
Chapter 21: Updating Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1167
Chapter 22: More on Windows Forms Applications . . . . . . . . . . . . . . . . . . 1217
Chapter 23: Accessing Data Sources in a Windows Forms Application . . . 1265
Appendix A: C++ Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1307
Appendix B: ASCII Codes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1309
Appendix C: Windows Message Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1317
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1319
25905ffirs.qxd:WroxPro 2/21/08 8:27 AM Page i
25905ffirs.qxd:WroxPro 2/21/08 8:27 AM Page ii
Ivor Horton’s
Beginning
Visual C++
®
2008
Ivor Horton
25905ffirs.qxd:WroxPro 2/21/08 8:27 AM Page iii