Skip to main content

Ivor Horton's Beginning Visual C++ 2010

Ivor Horton's Beginning Visual C++ 2010

Ivor Horton

ISBN: 978-1-118-98394-2

Jun 2014

1231 pages

Select type: O-Book

Description

The leading author of programming tutorials for beginners introduces you to Visual C++ 2010

Ivor Horton is the preeminent author of introductory programming language tutorials; previous editions of his Beginning Visual C++ have sold nearly 100,000 copies. This book is a comprehensive introduction to both the Standard C++ language and to Visual C++ 2010; no previous programming experience is required.

All aspects of the 2010 release are covered, including changes to the language and the C++ standard..

  • Microsoft Visual C++ is one of the most popular C++ development environments and compilers, used by hundreds of thousands of developers
  • Ivor Horton's approach to programming tutorials has achieved a huge following; this book gives beginning programmers a comprehensive introduction to both Standard C++ and Visual C++ 2010
  • Covers all the language changes in Visual C++ 2010, library additions, new MFC features, changes in the Visual Studio development environment, and more
  • Also includes a brief introduction to programming for multicore processors in native C++ and C++/CLR processors
  • Nearly 100,000 copies of this book have been sold in previous editions

Beginners seeking a complete education in Visual C++ will find everything they need in Ivor Horton's Beginning Visual C++ 2010.

INTRODUCTION xxxiii

CHAPTER 1: PROGRAMMING WITH VISUAL C++ 2010 1

CHAPTER 2: DATA, VARIABLES, AND CALCULATIONS 35

CHAPTER 3: DECISIONS AND LOOPS 121

CHAPTER 4: ARRAYS, STRINGS, AND POINTERS 167

CHAPTER 5: INTRODUCING STRUCTURE INTO YOUR PROGRAMS 251

CHAPTER 6: MORE ABOUT PROGRAM STRUCTURE 295

CHAPTER 7: DEFINING YOUR OWN DATA TYPES 353

CHAPTER 8: MORE ON CLASSES 435

CHAPTER 9: CLASS INHERITANCE AND VIRTUAL FUNCTIONS 549

CHAPTER 10: THE STANDARD TEMPLATE LIBRARY 645

CHAPTER 11: DEBUGGING TECHNIQUES 755

CHAPTER 12: WINDOWS PROGRAMMING CONCEPTS 807

CHAPTER 13: PROGRAMMING FOR MULTIPLE CORES 843

CHAPTER 14: WINDOWS PROGRAMMING WITH THE MICROSOFT FOUNDATION CLASSES 875

CHAPTER 15: WORKING WITH MENUS AND TOOLBARS 903

CHAPTER 16: DRAWING IN A WINDOW 945

CHAPTER 17: CREATING THE DOCUMENT AND IMPROVING THE VIEW 1009

CHAPTER 18: WORKING WITH DIALOGS AND CONTROLS 1059

CHAPTER 19: STORING AND PRINTING DOCUMENTS 1123

CHAPTER 20: WRITING YOUR OWN DLLs 1175

INDEX 1193

ReadMe doc
Download
Chapter 01 code downloads
Download
Chapter 02 code downloads
Download
Chapter 03 code downloads
Download
Chapter 04 code downloads
Download
Chapter 05 code downloads
Download
Chapter 06 code downloads
Download
Chapter 07 code downloads
Download
Chapter 08 code downloads
Download
Chapter 09 code downloads
Download
Chapter 10 code downloads
Download
Chapter 11 code downloads
Download
Chapter 12 code downloads
Download
Chapter 13 code downloads
Download
Chapter 15 code downloads
Download
Chapter 16 code downloads
Download
Chapter 17 code downloads
Download
Chapter 18 code downloads
Download
Chapter 19 code downloads
Download
Chapter 20 code downloads
Download
All the code downloads from the book
Download
Exercise solutions for Ch 02
Download
Exercise solutions for Ch 03
Download
Exercise solutions for Ch 04
Download
Exercise solutions for Ch 05
Download
Exercise solutions for Ch 06
Download
Exercise solutions for Ch 07
Download
Exercise solutions for Ch 08
Download
Exercise solutions for Ch 09
Download
Exercise solutions for Ch 10
Download
Exercise solutions for Ch 13
Download
Exercise solutions for Ch 15
Download
Exercise solutions for Ch 16
Download
Exercise solutions for Ch 17
Download
Exercise solutions for Ch 18
Download
Exercise solutions for Ch 19
Download
Exercise solutions for Ch 20
Download
ChapterPageDetailsDatePrint Run
xxxviiError in Text
Top of page, typo/grammar ? ?You then can to progress to Windows application development??
Should be ?You then can progress to Windows application development??
12/1/2010

xxxviiError in Text
Bottom of page, step #3 in ?Try it out?
The word 'program' should replace the word ?database?.
12/1/2010

31Error in Code
Middle of page, ?? or select View->Toolbox??, Toolbox not listed here in VS 2010 unless you put the IDE in 'Expert Settings' mode?

Selecting the option for C++ settings initially with paid for editions of Visual Studio 2010 should make all the menu options available for that context, including the Toolbox and I am not aware of an "Expert Settings" option in this context. The free Express Edition of Visual Studio 2010 does have an "Expert Settings" option but the book is not specifically aimed at this version because it the limitations mean that many of the examples in the latter part of the book will not work. In particular, the MFC is not supported.
12/1/2010

57Error in Number
Last line of paragraph 4:
values from 3.4x10^-38

should read:
values from -3.4x10^38
10/18/11

58Error in Code
Table on page 58: "Int" should be "int"
11/14/2010

58Error in Text
Table:
Reads: unsigned long long is 4 bytes
Should read: unsigned long long is 8 bytes
03/26/2012

72Error in Text
Line 5 of paragraph 3:
converted to floating-point form

should read:
converted to integer form
10/18/11

88Error in Text
Second-to-last paragraph:
In the third statement

should read:
In the second statement
10/18/11

106Error in Text
7th line from the bottom should read:
"The packageWeight variable is now referenced by 1 and packageCount by 0 in the format string..."

(1 and 0 are reversed in the text.)
3/29/11

150Error in Code
Currently reads:

for (double x = 0.0 ; x!= 1.0 ; x+= 0.2)
cout <<x;
Should read:
   for(double x = 0.0; x != 1.0; x += 0.1)
     cout << x << endl;
03/30/2012

185Error in Text
The output should be: number1 = 66 &number1 = 0039FB08 number1 = 990 pnumber = 0039FB0C *pnumber = 99
10/25/11

185Error in Text
Currently, the last sentence on page 185 reads:
"The 0x pre xing the address values indicates that they are hexadecimal numbers."

This text should be deleted.
09/27/2012

208Error in Text
Since the new version was released, the original phrasing of the example:

int&& rx=x;

is no longer correct. The new example should read:

int&& rx = std::move(x);
9/26/2012

210Error in Figure
Figure 4-9 was drawn incorrectly: The arrowheads should all be shifted left by one box.
10/18/11

228, 230Errors in Code
Page 228, in program Ex4_16.cpp, first line after // Write top line of table AND Page 230, in 3rd paragraph, first line after //Write top line of table:

it should read Console::Write(L" |"); Four spaces instead of one space between the " and the |.
7/31/11

233Error in Code
code snippet:
Console::WriteLine(L"Students with Grade {0}:", gradeLetter+j);

should be:
Console::WriteLine(L"Students with Grade {0}:", wchar_t(gradeLetter+j));
7/31/11

272Typo
How It Works:
The Incr10() function

should be:
The incr10() function
10/18/11

313Error in Text
There is a typo in the last line of the section headed "Refernce Types and Overload Selection on page 313. The last word in the section, just before the box containing a Note, is "revalues" whereas it should read "rvalues".
10/14/2010

442Error in Figure
The text in the middle of Figure 8-1 should read:
CMessage motto2(motto1); // Calls the default copy constructor
10/18/11

478Typo in Code
Code line 8:
Count : 100

should be:
count : 100
10/18/11

483Error in Text
p 483 (Ex8_10), 1st para. When use the Ex 8_06 CBox class definition printed on p.461, you need to remove the "explicit" constructor qualifier to avoid a compiler error. The download version of the code is OK.
This error was a devil to track down as import of the Visual Studio error diagnosis was only apparent when the problem was solved.
2-16-11

493Error in Figure
Figure 8-8:
Ex8_08

should be:
Ex8_11
10/11/11

501Error in Code
The #include directive should be:
#include "Box.h
10/18/11

506Error in Figure
Figure 8-13:
Ex8_08

should be:
Ex8_11
10/11/11

571Typo
Line 3:
the fried function

should be:
the friend function
10/18/11

590Error in Text
Paragraph 2--The second sentence should read: "The second statement casts pContainer down the class hierarchy ..." as per Figure 9-5.
10/18/11

665Error in Text
The text "The private initPerson() function"
Should read "The private initName() function".
05/04/2011

770Error in Code
On page 770, last four lines -
"The string can then be treated as the representation of a number to some base, 32 say. The numerical value for the string 'fred', for instance is 6*323+18*322+5*321+4*320 and, assuming you expected to store 500 strings, you could calculate the hashed value of the key as:
6*323+18*322+5*321+4*320 mod 503"
These equation '6*323+18*322+5*321+4*320' should be expressed in a form like '6*32^3+18*32^2+5*32^1+4*32^0' where exponents of 32 are used.
12/14/2010

820Error in Code
The text in the code in page 820 is wrong. It's written:
hWnd = CreateWindow(
szAppName,
"A Basic Window the Hard Way",...
.
.
.

where the text "A Basic Window the Hard Way" should be:
L"A Basic Window the Hard Way"
01/02/2011

851Error in Code
On line 5, the expression:
a, c + di. + bi(c + di)

should be:
a(c + di) + bi(c + di)
04/03/2011

969Error in Figure
Figure 16-12:
The arrows should point toward the base class; therefore, the arrow should point from CElement to CObject.
10/18/11

1005Typo in Code
swittch(elementType)

should read:
switch(ElementType)
10/18/11

1015Error in Figure
Figure 17-2:
void UpdateAllView(...

should be:
void UpdateAllViews(...
10/18/11