Book description
Proudly presenting the latest edition of one of the all-time bestselling books on the C++ language, successful author Ivor Horton repeats the formula that has made each previous edition so popular by teaching you both the standard C++ language and C++/CLI as well as Visual C++ 2008. Thoroughly updated for the 2008 release, this book shows you how to build real-world applications using Visual C++ and guides you through the ins and outs of C++ development. With this book by your side, you are well on your way to becoming a successful C++ programmer.
Table of contents
- Copyright
- About the Author
- Acknowledgments
- Credits
- Introduction
-
1. Programming with Visual C++ 2008
- 1.1. The .NET Framework
- 1.2. The Common Language Runtime (CLR)
- 1.3. Writing C++ Applications
- 1.4. Learning Windows Programming
- 1.5. What Is the Integrated Development Environment?
- 1.6. Using the IDE
- 1.7. Summary
-
2. Data, Variables, and Calculations
- 2.1. The Structure of a C++ Program
- 2.2. Defining Variables
- 2.3. Fundamental Data Types
- 2.4. Basic Input/Output Operations
- 2.5. Calculating in C++
- 2.6. Variable Types and Casting
- 2.7. The Bitwise Operators
- 2.8. Understanding Storage Duration and Scope
- 2.9. Namespaces
- 2.10. C++/CLI Programming
- 2.11. Summary
- 2.12. Exercises
-
3. Decisions and Loops
- 3.1. Comparing Values
- 3.2. Repeating a Block of Statements
- 3.3. C++/CLI Programming
- 3.4. Summary
- 3.5. Exercises
-
4. Arrays, Strings, and Pointers
- 4.1. Handling Multiple Data Values of the Same Type
- 4.2. Indirect Data Access
- 4.3. Dynamic Memory Allocation
- 4.4. Using References
- 4.5. Native C++ Library Functions for Strings
- 4.6. C++/CLI Programming
- 4.7. Summary
- 4.8. Exercises
-
5. Introducing Structure into Your Programs
- 5.1. Understanding Functions
- 5.2. Passing Arguments to a Function
- 5.3. Returning Values from a Function
- 5.4. Recursive Function Calls
- 5.5. C++/CLI Programming
- 5.6. Summary
- 5.7. Exercises
-
6. More about Program Structure
- 6.1. Pointers to Functions
- 6.2. Initializing Function Parameters
- 6.3. Exceptions
- 6.4. Handling Memory Allocation Errors
- 6.5. Function Overloading
- 6.6. Function Templates
- 6.7. An Example Using Functions
- 6.8. C++/CLI Programming
- 6.9. Summary
- 6.10. Exercises
-
7. Defining Your Own Data Types
- 7.1. The struct in C++
- 7.2. Data Types, Objects, Classes, and Instances
- 7.3. Understanding Classes
- 7.4. Class Constructors
- 7.5. Private Members of a Class
- 7.6. The Pointer this
- 7.7. const Objects of a Class
- 7.8. Arrays of Objects of a Class
- 7.9. Static Members of a Class
- 7.10. Pointers and References to Class Objects
- 7.11. C++/CLI Programming
- 7.12. Summary
- 7.13. Exercises
-
8. More on Classes
- 8.1. Class Destructors
- 8.2. Implementing a Copy Constructor
- 8.3. Sharing Memory Between Variables
- 8.4. Operator Overloading
- 8.5. Class Templates
-
8.6. Using Classes
- 8.6.1. The Idea of a Class Interface
- 8.6.2. Defining the Problem
-
8.6.3. Implementing the CBox Class
- 8.6.3.1. Comparing CBox Objects
- 8.6.3.2. Combining CBox Objects
- 8.6.3.3. Analyzing CBox Objects
- 8.6.3.4. Defining the CBox Class
- 8.6.3.5. Adding Data Members
- 8.6.3.6. Defining the Constructor
- 8.6.3.7. Adding Function Members
- 8.6.3.8. Adding Global Functions
- 8.6.3.9. Using Our CBox Class
- 8.6.3.10. How It Works
- 8.7. Organizing Your Program Code
- 8.8. Native C++ Library Classes for Strings
- 8.9. C++/CLI Programming
- 8.10. Summary
- 8.11. Exercises
-
9. Class Inheritance and Virtual Functions
- 9.1. Basic Ideas of OOP
- 9.2. Inheritance in Classes
- 9.3. Access Control Under Inheritance
- 9.4. The Copy Constructor in a Derived Class
- 9.5. Class Members as Friends
- 9.6. Virtual Functions
- 9.7. Casting Between Class Types
- 9.8. Nested Classes
- 9.9. C++/CLI Programming
- 9.10. Summary
- 9.11. Exercises
-
10. The Standard Template Library
- 10.1. What Is the Standard Template Library?
- 10.2. The Range of STL Containers
-
10.3. Sequence Containers
- 10.3.1. Creating Vector Containers
- 10.3.2. The Capacity and Size of a Vector Container
- 10.3.3. Accessing the Elements in a Vector
- 10.3.4. Inserting and Deleting Elements in a Vector
- 10.3.5. Storing Class Objects in a Vector
- 10.3.6. Sorting Vector Elements
- 10.3.7. Storing Pointers in a Vector
- 10.3.8. Double-Ended Queue Containers
- 10.3.9. Using List Containers
- 10.3.10. Using Other Sequence Containers
- 10.4. Associative Containers
- 10.5. More on Iterators
- 10.6. More on Function Objects
- 10.7. More on Algorithms
- 10.8. The STL for C++/CLI Programs
- 10.9. Summary
- 10.10. Exercises
- 11. Debugging Techniques
-
12. Windows Programming Concepts
- 12.1. Windows Programming Basics
-
12.2. The Structure of a Windows Program
- 12.2.1. The WinMain() Function
- 12.2.2. Message Processing Functions
- 12.2.3. A Simple Windows Program
- 12.3. Windows Program Organization
- 12.4. The Microsoft Foundation Classes
- 12.5. Using Windows Forms
- 12.6. Summary
- 13. Windows Programming with the Microsoft Foundation Classes
-
14. Working with Menus and Toolbars
- 14.1. Communicating with Windows
- 14.2. Extending the Sketcher Program
- 14.3. Elements of a Menu
- 14.4. Adding Handlers for Menu Messages
- 14.5. Adding Toolbar Buttons
- 14.6. Menu and Toolbars in a C++/CLI Program
- 14.7. Summary
- 14.8. Exercises
-
15. Drawing in a Window
- 15.1. Basics of Drawing in a Window
- 15.2. The Drawing Mechanism in Visual C++
- 15.3. Drawing Graphics in Practice
-
15.4. Programming the Mouse
- 15.4.1. Messages from the Mouse
- 15.4.2. Mouse Message Handlers
-
15.4.3. Drawing Using the Mouse
- 15.4.3.1. Getting the Client Area Redrawn
- 15.4.3.2. Defining Classes for Elements
- 15.4.3.3. The CElement Class
- 15.4.3.4. The CLine Class
- 15.4.3.5. Calculating the Enclosing Rectangle for a Line
- 15.4.3.6. The CRectangle Class
- 15.4.3.7. The CCircle Class
- 15.4.3.8. The CCurve Class
- 15.4.3.9. Completing the Mouse Message Handlers
- 15.5. Exercising Sketcher
- 15.6. Drawing with the CLR
- 15.7. Summary
- 15.8. Exercises
-
16. Creating the Document and Improving the View
- 16.1. The MFC Collection Classes
- 16.2. Using the CList Template Class
- 16.3. Creating the Sketch Document
- 16.4. Improving the View
- 16.5. Deleting and Moving Shapes
- 16.6. Implementing a Context Menu
- 16.7. Dealing with Masked Elements
- 16.8. Extending CLRSketcher
- 16.9. Summary
- 16.10. Exercises
-
17. Working with Dialogs and Controls
- 17.1. Understanding Dialogs
- 17.2. Understanding Controls
- 17.3. Creating a Dialog Resource
- 17.4. Programming for a Dialog
- 17.5. Supporting the Dialog Controls
- 17.6. Completing Dialog Operations
- 17.7. Using a Spin Button Control
- 17.8. Using the Scale Factor
- 17.9. Working with Status Bars
- 17.10. Using a List Box
- 17.11. Using an Edit Box Control
- 17.12. Dialogs and Controls in CLR Sketcher
- 17.13. Summary
- 17.14. Exercises
-
18. Storing and Printing Documents
- 18.1. Understanding Serialization
- 18.2. Serializing a Document
- 18.3. Applying Serialization
- 18.4. Exercising Serialization
- 18.5. Moving Text
- 18.6. Printing a Document
- 18.7. Implementing Multipage Printing
- 18.8. Serialization and Printing in CLR Sketcher
- 18.9. Summary
- 18.10. Exercises
-
19. Writing Your Own DLLs
- 19.1. Understanding DLLs
- 19.2. Deciding What to Put in a DLL
- 19.3. Writing DLLs
- 19.4. Summary
- 19.5. Exercises
-
20. Connecting to Data Sources
- 20.1. Database Basics
- 20.2. A Little SQL
- 20.3. Database Support in MFC
- 20.4. Creating a Database Application
- 20.5. Sorting a Recordset
- 20.6. Using a Second Recordset Object
- 20.7. Viewing Customer Details
- 20.8. Summary
- 20.9. Exercises
-
21. Updating Data Sources
- 21.1. Update Operations
- 21.2. A Simple Update Example
- 21.3. Managing the Update Process
-
21.4. Adding Rows to a Table
- 21.4.1. The Order Entry Process
- 21.4.2. Creating the Resources
- 21.4.3. Creating the Recordsets
- 21.4.4. Creating the Recordset Views
- 21.4.5. Adding Controls to the Dialog Resources
- 21.4.6. Implementing Dialog Switching
- 21.4.7. Creating an Order ID
- 21.4.8. Storing the Order Data
- 21.4.9. Selecting Products for an Order
- 21.4.10. Adding a New Order
- 21.5. Summary
- 21.6. Exercises
-
22. More on Windows Forms Applications
-
22.1. Creating the Application GUI
- 22.1.1. Adding Submenus
- 22.1.2. Adding a Tab Control
- 22.1.3. Using GroupBox Controls
- 22.1.4. Using Button Controls
- 22.1.5. Using the WebBrowser Control
- 22.1.6. Operation of the Winning Application
- 22.1.7. Adding a Context Menu
- 22.1.8. Creating Event Handlers
- 22.1.9. Handling Events for the Limits Menu
- 22.1.10. Creating a Dialog Box
- 22.1.11. Using the Dialog Box
- 22.1.12. Adding the Second Dialog
- 22.1.13. Implementing the Help > About Menu Item
- 22.1.14. Handling a Button Click
- 22.1.15. Responding to the Context Menu
- 22.2. Summary
- 22.3. Exercises
-
22.1. Creating the Application GUI
-
23. Accessing Data Sources in a Windows Forms Application
- 23.1. Working with Data Sources
- 23.2. Accessing and Displaying Data
- 23.3. Using a DataGridView Control
- 23.4. Using a DataGridView Control in Unbound Mode
- 23.5. Customizing a DataGridView Control
- 23.6. Using Bound Mode
- 23.7. The BindingSource Component
- 23.8. Using the BindingNavigator Control
- 23.9. Binding to Individual Controls
- 23.10. Working with Multiple Tables
- 23.11. Summary
- 23.12. Exercises
- A. C++ Keywords
- B. ASCII Codes
- C. Windows Message Types
Product information
- Title: Ivor Horton's Beginning Visual C++®2008
- Author(s):
- Release date: March 2008
- Publisher(s): Wrox
- ISBN: 9780470225905
You might also like
book
Hands-On Network Programming with C
A comprehensive guide to programming with network sockets, implementing Internet protocols, designing IoT devices, and much …
book
Concurrency in C# Cookbook, 2nd Edition
If you’re one of many developers still uncertain about concurrent and multithreaded development, this practical cookbook …
book
C++ Primer Plus
C++ Primer Plus, Sixth Edition New C++11 Coverage C++ Primer Plus is a carefully crafted, complete …
book
Learn C++ for Game Development
" If you're new to C++ but understand some basic programming, then Learn C++ for Game …