Ivor Horton's beginning Visual C++ 2012 /
The only book to teach C++ programming with Microsoft Visual Studio! There's a reason why Ivor Horton's Beginning Visual C++ books dominate the marketplace. Ivor Horton has a loyal following who love his winning approach to teaching programming languages, and in this fully updated new edit...
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Hoboken, N.J. : Chichester :
Wiley ; John Wiley [distributor],
2012.
|
Colección: | Wrox beginning guides.
|
Temas: | |
Acceso en línea: | Texto completo Texto completo |
Tabla de Contenidos:
- Machine generated contents note: ch. 1 Programming With Visual C++
- Learning with Visual C++
- Writing C++ Applications
- Learning Desktop Applications Programming
- Learning C++
- Console Applications
- Windows Programming Concepts
- What Is the Integrated Development Environment?
- Editor
- Compiler
- Linker
- Libraries
- Using the IDE
- Toolbar Options
- Dockable Toolbars
- Documentation
- Projects and Solutions
- Defining a Project
- Debug and Release Versions of Your Program
- Executing the Program
- Dealing with Errors
- Setting Options in Visual C++
- Creating and Executing Windows Applications
- Creating an MFC Application
- Building and Executing the MFC Application
- Summary
- ch. 2 Data, Variables, and Calculations
- Structure of a C++ Program
- Program Comments
- #include Directive
- Header Files
- Namespaces and the Using Declaration
- main() Function
- Program Statements
- Whitespace
- Statement Blocks
- Automatically Generated Console Programs
- Precompiled Header Files
- Main Function Names
- Defining Variables
- Naming Variables
- Keywords in C++
- Declaring Variables
- Initial Values for Variables
- Fundamental Data Types
- Integer Variables
- Character Data Types
- Integer Type Modifiers
- Boolean Type
- Floating-Point Types
- Fundamental Types in C++
- Literals
- Defining Synonyms for Data Types
- Basic Input/Output Operations
- Input from the Keyboard
- Output to the Command Line
- Formatting the Output
- Escape Sequences
- Calculating in C++
- Assignment Statement
- Arithmetic Operations
- const Modifier
- Constant Expressions
- Program Input
- Calculating the Result
- Displaying the Result
- Calculating a Remainder
- Modifying a Variable
- Increment and Decrement Operators
- Sequence of Calculation
- Operator Precedence
- Type Conversion and Casting
- Type Conversion in Assignments
- Explicit Type Conversion
- Old-Style Casts
- auto Keyword
- Discovering Types
- Bitwise Operators
- Bitwise AND
- Bitwise OR
- Bitwise Exclusive OR
- Bitwise NOT
- Bitwise Shift Operators
- Introducing Lvalues and Rvalues
- Understanding Storage Duration and Scope
- Automatic Variables
- Positioning Variable Declarations
- Global Variables
- Static Variables
- Variables with Specific Sets of Values
- Old Enumerations
- Type-Safe Enumerations
- Namespaces
- Declaring a Namespace
- Multiple Namespaces
- Summary
- ch. 3 Decisions and Loops
- Comparing Values
- if Statement
- Nested if Statements
- Extended if Statement
- Nested if-else Statements
- Logical Operators and Expressions
- Logical AND
- Logical OR
- Logical NOT
- Conditional Operator
- switch Statement
- Unconditional Branching
- Repeating a Block of Statements
- What Is a Loop?
- Variations on the for Loop
- Using the continue Statement
- Floating-Point Loop Counters
- while Loop
- do-while Loop
- Range-Based for Loop
- Nested Loops
- Summary
- ch. 4 Arrays, Strings, and Pointers
- Handling Multiple Data Values of the Same Type
- Arrays
- Declaring Arrays
- Initializing Arrays
- Using the Range-Based for Loop
- Character Arrays and String Handling
- String Input
- Using the Range-Based for Loop with Strings
- Multidimensional Arrays
- Initializing Multidimensional Arrays
- Indirect Data Access
- What Is a Pointer?
- Declaring Pointers
- Address-Of Operator
- Using Pointers
- Indirection Operator
- Why Use Pointers?
- Initializing Pointers
- Pointers to char
- sizeof Operator
- Constant Pointers and Pointers to Constants
- Pointers and Arrays
- Pointer Arithmetic
- Using Pointers with Multidimensional Arrays
- Pointer Notation with Multidimensional Arrays
- Dynamic Memory Allocation
- Free Store, Alias the Heap
- new and delete Operators
- Allocating Memory Dynamically for Arrays
- Dynamic Allocation of Multidimensional Arrays
- Using References
- What Is a Reference?
- Declaring and Initializing Lvalue References
- Using References in a Range-Based for Loop
- Rvalue References
- Library Functions for Strings
- Finding the Length of a Null-Terminated String
- Joining Null-Terminated Strings
- Copying Null-Terminated Strings
- Comparing Null-Terminated Strings
- Searching Null-Terminated Strings
- Summary
- ch. 5 Introducing Structure Into Your Programs
- Understanding Functions
- Why Do You Need Functions?
- Structure of a Function
- Function Header
- Function Body
- return Statement
- Alternative Function Syntax
- Using a Function
- Function Prototypes
- Passing Arguments to a Function
- Pass-by-Value Mechanism
- Pointers as Arguments to a Function
- Passing Arrays to a Function
- Passing Multidimensional Arrays to a Function
- References as Arguments to a Function
- Use of the const Modifier
- Rvalue Reference Parameters
- Arguments to main()
- Accepting a Variable Number of Function Arguments
- Returning Values from a Function
- Returning a Pointer
- Cast-iron Rule for Returning Addresses
- Returning a Reference
- Teflon-Coated Rule: Returning References
- Static Variables in a Function
- Recursive Function Calls
- Using Recursion
- Summary
- ch. 6 More About Program Structure
- Pointers to Functions
- Declaring Pointers to Functions
- Pointer to a Function as an Argument
- Arrays of Pointers to Functions
- Initializing Function Parameters
- Exceptions
- Throwing Exceptions
- Catching Exceptions
- Rethrowing Exceptions
- Exception Handling in the MFC
- Handling Memory Allocation Errors
- Function Overloading
- What Is Function Overloading?
- Reference Types and Overload Selection
- When to Overload Functions
- Function Templates
- Using a Function Template
- Using the decltype Operator
- Example Using Functions
- Implementing a Calculator
- Analyzing the Problem
- Eliminating Blanks from a String
- How the Function Functions
- Evaluating an Expression
- How the Function Functions
- Getting the Value of a Term
- How the Function Functions
- Analyzing a Number
- How the Function Functions
- Putting the Program Together
- How the Function Functions
- Extending the Program
- How the Function Functions
- Extracting a Substring
- How the Function Functions
- Running the Modified Program
- Summary
- ch. 7 Defining Your Own Data Types
- struct in C++
- What Is a struct?
- Defining a struct
- Initializing a struct
- Accessing the Members of a struct
- IntelliSense Assistance with Structures
- struct RECT
- Using Pointers with a struct
- Accessing Structure Members through a Pointer
- Indirect Member Selection Operator
- Types, Objects, Classes, and Instances
- First Class
- Operations on Classes
- Terminology
- Understanding Classes
- Defining a Class
- Access Control in a Class
- Declaring Objects of a Class
- Accessing the Data Members of a Class
- Member Functions of a Class
- Positioning a Member Function Definition
- Inline Functions
- Class Constructors
- What Is a Constructor?
- Default Constructor
- Default Parameter Values
- Using an Initialization List in a Constructor
- Making a Constructor Explicit
- Private Members of a Class
- Accessing private Class Members
- friend Functions of a Class
- Placing friend Function Definitions Inside the Class
- Default Copy Constructor
- Pointer this
- const Objects
- const Member Functions of a Class
- Member Function Definitions Outside the Class
- Arrays of Objects
- Static Members of a Class
- Static Data Members
- Static Function Members of a Class
- Pointers and References to Objects
- Pointers to Objects
- References to Class Objects
- Implementing a Copy Constructor
- Summary
- ch.
- 8 More on Classes
- Class Destructors
- What Is a Destructor?
- Default Destructor
- Destructors and Dynamic Memory Allocation
- Implementing a Copy Constructor
- Sharing Memory Between Variables
- Defining Unions
- Anonymous Unions
- Unions in Classes and Structures
- Operator Overloading
- Implementing an Overloaded Operator
- Implementing Full Support for Comparison Operators
- Overloading the Assignment Operator
- Fixing the Problem
- Overloading the Addition Operator
- Overloading the Increment and Decrement Operators
- Overloading the Function Call Operator
- Object Copying Problem
- Avoiding Unnecessary Copy Operations
- Applying Rvalue Reference Parameters
- Named Objects are Lvalues
- Default Class Members
- Class Templates
- Defining a Class Template
- Template Member Functions
- Creating Objects from a Class Template
- Class Templates with Multiple Parameters
- Templates for Function Objects
- Perfect Forwarding
- Using Classes
- Idea of a Class Interface
- Defining the Problem
- Implementing the CBox Class
- Comparing CBox Objects
- Combining CBox Objects
- Analyzing CBox Objects
- Organizing Your Program Code
- Naming Program Files
- Library Classes for Strings
- Creating String Objects
- Concatenating Strings
- Accessing and Modifying Strings
- Comparing Strings
- Searching Strings
- Summary
- ch. 9 Class Inheritance and Virtual Functions
- Object-Oriented Programming Basics
- Inheritance in Classes
- What Is a Base Class?
- Deriving Classes from a Base Class
- Access Control Under Inheritance.
- Note continued: Constructor Operation in a Derived Class
- Declaring Protected Class Members
- Access Level of Inherited Class Members
- Copy Constructor in a Derived Class
- Preventing Class Derivation
- Class Members as Friends
- Friend Classes
- Limitations on Class Friendship
- Virtual Functions
- What Is a Virtual Function?
- Ensuring Correct Virtual Function Operation
- Preventing Function Overriding
- Using Pointers to Class Objects
- Using References with Virtual Functions
- Incomplete Class Declaration
- Pure Virtual Functions
- Abstract Classes
- Indirect Base Classes
- Virtual Destructors
- Casting Between Class Types
- Nested Classes
- Summary
- ch. 10 Standard Template Library
- What Is the Standard Template Library?
- Containers
- Allocators
- Comparators
- Container Adapters
- Iterators
- Iterator Categories
- SCARY Iterators
- std::begin() and std::end() Functions
- Smart Pointers
- Using unique_ptr Objects
- Using shared_ptr Objects
- Accessing the Raw Pointer in a Smart Pointer
- Casting SmartPointers
- Algorithms
- Function Objects in the STL
- Function Adapters
- Range of STL Containers
- Sequence Containers
- Creating Vector Containers
- Capacity and Size of a Vector Container
- Accessing the Elements in a Vector
- Inserting and Deleting Elements in a Vector
- Insert Operations
- Emplace Operations
- Erase Operations
- Swap and Assign Operations
- Storing Class Objects in a Vector
- Sorting Vector Elements
- Storing Pointers in a Vector
- Array Containers
- Double-Ended Queue Containers
- Using List Containers
- Adding Elements to a List
- Accessing Elements in a List
- Sorting List Elements
- Other Operations on Lists
- Using forward_list Containers
- Using Other Sequence Containers
- Queue Containers
- Priority Queue Containers
- Stack Containers
- tuple Class Template
- Associative Containers
- Using Map Containers
- Storing Objects
- Accessing Objects
- Other Map Operations
- Using a Multimap Container
- More on Iterators
- Using Input Stream Iterators
- Using Inserter Iterators
- Using Output Stream Iterators
- More on Function Objects
- More on Algorithms
- Type Traits and Static Assertions
- Lambda Expressions
- Capture Clause
- Capturing Specific Variables
- Templates and Lambda Expressions
- Naming a Lambda Expression
- Summary
- ch. 11 Windows Programming Concepts
- Windows Programming Basics
- Elements of a Window
- Windows Programs and the Operating System
- Event-Driven Programs
- Windows Messages
- Windows API
- Windows Data Types
- Notation in Windows Programs
- Structure of a Windows Program
- WinMain() Function
- Specifying a Program Window
- Creating a Program Window
- Initializing the Program Window
- Dealing with Windows Messages
- Complete WinMain() Function
- How It Works
- Processing Windows Messages
- WindowProc() Function
- Decoding a Windows Message
- Ending the Program
- Complete WindowProc() Function
- How It Works
- Microsoft Foundation Classes
- MFC Notation
- How an MFC Program Is Structured
- Summary
- ch. 12 Windows Programming With the Microsoft Foundation Classes (MFC)
- MFC Document/View Concept
- What Is a Document?
- Document Interfaces
- What Is a View?
- Linking a Document and Its Views
- Document Templates
- Document Template Classes
- Your Application and MFC
- Creating MFC Applications
- Creating an SDI Application
- MFC Application Wizard Output
- Viewing Project Files
- Viewing Classes
- Class Definitions
- Creating an Executable Module
- Running the Program
- How the Program Works
- Creating an MDI Application
- Running the Program
- Summary
- ch. 13 Working With Menus And Toolbars
- Communicating with Windows
- Understanding Message Maps
- Message Handler Definitions
- Message Categories
- Handling Messages in Your Program
- How Command Messages Are Processed
- Extending the Sketcher Program
- Elements of a Menu
- Creating and Editing Menu Resources
- Adding a Menu Item to the Menu Bar
- Adding Items to the Element Menu
- Modifying Existing Menu Items
- Completing the Menu
- Adding Menu Message Handlers
- Choosing a Class to Handle Menu Messages
- Creating Menu Message Handlers
- Implementing Menu Message Handlers
- Adding Members to Store Color and Element Mode
- Defining Element and Color Types
- Initializing the Color and Element Type Members
- Implementing Menu Command Message Handlers
- Running the Extended Example
- Adding Menu Update Message Handlers
- Coding a Command Update Handler
- Exercising the Update Handlers
- Adding Toolbar Buttons
- Editing Toolbar Button Properties
- Exercising the Toolbar Buttons
- Adding Tooltips
- Summary
- ch. 14 Drawing in a Window
- Basics of Drawing in a Window
- Window Client Area
- Windows Graphical Device Interface
- Working with a Device Context
- Mapping Modes
- MFC Drawing Mechanism
- View Class in Your Application
- OnDraw() Member Function
- CDC Class
- Displaying Graphics
- Drawing in Color
- Drawing Graphics in Practice
- Programming for the Mouse
- Messages from the Mouse
- Wm_Lbuttondown
- Wm_Mousemove
- Wm_Lbuttonup
- Mouse Message Handlers
- Drawing Using the Mouse
- Getting the Client Area Redrawn
- Defining Element Classes
- CElement Class
- CLine Class
- CRectangle Class
- CCircle Class
- CCurve Class
- Completing the Mouse Message Handlers
- Drawing a Sketch
- Running the Example
- Capturing Mouse Messages
- Summary
- ch. 15 Improving The View
- Sketcher Limitations
- Improving the View
- Updating Multiple Views
- Scrolling Views
- Logical Coordinates and Client Coordinates
- Dealing with Client Coordinates
- Using MM_LOENGLISH Mapping Mode
- Deleting and Moving Elements
- Implementing a Context Menu
- Associating a Menu with a Class
- Checking Context Menu Items
- Identifying an Element under the Cursor
- Exercising the Context Menus
- Highlighting Elements
- Drawing Highlighted Elements
- Exercising the Highlights
- Implementing Move and Delete
- Deleting an Element
- Moving an Element
- Updating Other Views
- Getting the Elements to Move Themselves
- Dropping the Element
- Exercising the Application
- Dealing with Masked Elements
- Summary
- ch. 16 Working With Dialogs and Controls
- Understanding Dialogs
- Understanding Controls
- Creating a Dialog Resource
- Adding Controls to a Dialog
- Testing the Dialog
- Programming for a Dialog
- Adding a Dialog Class
- Modal and Modeless Dialogs
- Displaying a Dialog
- Displaying the Dialog
- Code to Close the Dialog
- Supporting the Dialog Controls
- Initializing Dialog Controls
- Handling Radio Button Messages
- Completing Dialog Operations
- Adding Pen Widths to the Document
- Adding Pen Widths to the Elements
- Creating Elements in the View
- Exercising the Dialog
- Using a Spin Button Control
- Adding a Scale Menu Item and Toolbar Button
- Creating the Spin Button
- Controls' Tab Sequence
- Generating the Scale Dialog Class
- Dialog Data Exchange and Validation
- Initializing the Dialog
- Displaying the Spin Button
- Using the Scale Factor
- Scalable Mapping Modes
- Setting the Document Size
- Setting the Mapping Mode
- Implementing Scrolling with Scaling
- Setting Up the Scrollbars
- Working with Status Bars
- Adding a Status Bar to a Frame
- Creating Status Bar Panes
- Updating the Status Bar
- CString Class
- Using an Edit Box Control
- Creating an Edit Box Resource
- Creating the Dialog Class
- Adding the Text Menu Item
- Defining a Text Element
- Implementing the CText Class
- CText Constructor
- Creating a Text Element
- Drawing a CText Object
- Moving a CText Object
- Summary
- ch.
- 17 Storing and Printing Documents
- Understanding Serialization
- Serializing a Document
- Serialization in the Document Class Definition
- Serialization in the Document Class Implementation
- Serialize() Function
- CArchive Class
- Functionality of CObject-Based Classes
- Macros that Add Serialization to a Class
- How Serialization Works
- How to Implement Serialization for a Class
- Applying Serialization
- Recording Document Changes
- Serializing the Document
- Serializing the Element Classes
- Serialize() Functions for the Element Classes
- Exercising Serialization
- Printing a Document
- Printing Process
- CPrintInfo Class
- Implementing Multipage Printing
- Getting the Overall Document Size
- Storing Print Data
- Preparing to Print
- Cleaning Up after Printing
- Preparing the Device Context
- Printing the Document
- Getting a Printout of the Document
- Summary
- ch. 18 Programming Windows 8 Apps
- Understanding Windows 8 Apps
- Developing Windows 8 Apps
- Windows Runtime Concepts
- WinRT Namespaces
- WinRT Objects
- C++ Component Extensions (C++/CX)
- C++/CX Namespaces
- Defining WinRT Class Types
- Variables of Ref Class Types
- Accessing Members of a Ref Class Object
- Event Handler Functions
- Casting Ref Class References
- extensible Application Markup Language (XAML)
- XAML Elements
- UI Elements in XAML
- Attached Properties
- Parents and Children
- Control Elements
- Layout Elements
- Handling Events for UI Elements
- Creating a Windows 8 App.
- Note continued: Application Files
- Defining the User Interface
- Creating the Title
- Adding Game Controls
- Creating a Grid to Contain the Cards
- Defining a Card
- Creating a Card
- Adding Event Handling
- Creating All the Cards
- Implementing Game Operations
- Defining the Card Class
- Adding Data Members to the MainPage Class
- Adding Function Members
- Initialize the MainPage Object
- Initializing the Card Pack
- Setting Up the Child Elements of cardGrid
- Initializing the Game
- Shuffling the Cards
- Highlighting the UI Cards
- Handling Card Back Events
- Handling Shape Events
- Recognizing a Win
- Handling Game Control Button Events
- Scaling UI Elements
- Transitions
- Application Startup Transitions
- Storyboard Animations
- Summary.