Topic: C# and C++

Ivor Horton's Beginning Visual C++ 2008 (0470225904) cover image

Ivor Horton's Beginning Visual C++ 2008

Ivor Horton
ISBN: 978-0-470-22590-5
Paperback
1392 pages
March 2008
Other Available Formats: E-book
This title is out-of-print and not currently available for purchase from this site.

Do you think you've discovered an error in this book? Please check the list of errata below to see if we've already addressed the error. If not, please submit the error via our Errata Form. We will attempt to verify your error; if you're right, we will post a correction below.

ChapterPageDetailsDatePrint Run
3 Error in Text
"because data and code is managed"

should be:

"because data and code are managed"
06/16/2008
21 Error in Text
"After you have entered the project name... click Applications Settings on the right side"

should be

"After you have entered the project name... click Applications Settings on the left side (right below Overview)"

11/13/08
47 Typo
represents a working program at it stands.

should be:
represents a working program as it stands.
08/25/08
55 Missing word
first paragraph under the heading "The Boolean Type":
"Boolean variables are variables can have only..."

should be:
"Boolean variables are variables that can have only..."
04/05/08
64 Typo
last line:
here

should be:
hear
09/02/08
64 Typo in Code
cout << "\n\tThe program\'s over, it\'s time take make a beep beep.\a\a";

Should be:
cout << "\n\tThe program\'s over, it\'s time to make a beep beep.\a\a";
10/4/11
86 Missing word
next to last paragraph under the heading "Understanding Storage Duration and Scope", 3rd sentence reads:
"either to set its value or to it in an expression."

should be:
"either to set its value or to use it in an expression."
04/05/08
96 Error in Text
the paragraph above the last block of grey highlighted information on the page, in the 3rd or next to last sentence, it reads:
"deliberately, but in can arise..." Should be: "deliberately, but it can arise..."
04/05/08
213 Error in Code
code listing:
for (int i = 0 ; i < sample->Length ; i++)

should be:
for (int i = 0 ; i < samples->Length ; i++)
08/04/08
225 Error in Text
Near bottom of page:

String^ formatStr1 = L"{0,"

Should be: String^ formatStr1 = L"{0,";
11/2/09
230 Error in Code
Second code snippet:

Console::WriteLine(L"The sentence does{0]

Should be:

Console::WriteLine(L"The sentence does{0}
11/2/09
231 Error in Text
On page 231, the end of the second paragraph before the "Try It Out" should say:

"...if the left operand of the && operator is false, the right operand is not evaluated"
1/15/09
233 Error in Text
Bottom of page 233 in the 'Interior Pointers' paragraph:

An interior point is always an automatic variable that is local to a function.

Should be

An interior pointer is always an automatic variable that is local to a function.
2/10/09
233 Error in Text
In the Tracking References section, paragraph 3:

The second statement defines stackValue to be a tracking reference to the variable value, which has been created on the stack. You can now modify value using stackValue:

Should be:

The second statement defines trackValue to be a tracking reference to the variable value, which has been created on the stack. You can now modify value using trackValue:
11/2/09
234 Error in Text
In the last sentence of the Try it Out, first word in line:

points.

should be:

pointers.
11/2/09
263 Error in Text
In section "Returning a Pointer", the line above the code block:

"Our first attempt the implement such a function..."

should be:

"Our first attempt to implement such a function..."
07/16/2008
366 Error in Text
Section Title: The Pointer this; 2nd paragraph:

Volume() function during execution, it's actually referring to this>m_Len

Should be:
Volume() function during execution, it's actually referring to this->m_Len
07/17/08
474 Error in Code
In Ex8_09.cpp

The problem is with the listnames function. In the book it appears as this:

void listnames(string names[], string ages[], size_t count)
{
size_t i = 0;
cout << endl << "The names you entered are: " << endl;
while(i<count && !names[i].empty())
cout << names[i] + " aged " + ages[i++] + '.' << endl;
}

The suggested correction that works is the following:

void listnames(string names[], string ages[], size_t count)
{
size_t i = 0;
cout << endl << "The names you entered are: " << endl;
while(i<count && !names[i].empty()){
cout << names[i] + " aged " + ages[i] + '.' << endl;
i++;
}
}
06/17/2008
502 Error in Code
The output for Ex8_13 on P502 should be:

275 feet 9 inches

14 feet 6 inches can be cut into 5 pieces 2 feet 6 inches long with 2 feet 0 inches left over.

1 feet 11 inches

2 feet 1 inches

2 feet 1 inches

02/25/09
9 551 Error in Code
The CStack class on page 551 should have the following constructor added to the public section of the class:

CStack():pTop(0){}

The loop in main() for Ex9_13.cpp on page 552 should retrieve items from the stack. The loop could be written:

CBox* pTemp(0);
while(pTemp = pStack->Pop())br> pTemp->ShowVolume();

It is good practice to delete all objects created on the stack, so there should be the following statement before the return in main():

delete pStack;

All objects created on the heap will of course be deleted on execution of the return in any event.
6/26/09
560 Error in Text
"first you create an array of handles to strings"

should be:

"first you create an array of handles to boxes"
07/06/2008
10 603 Error in Text
In chapter 10: The Standard Template Library,

in the "Container Adapters" section,

in the "<stack>" definition,

The first part of the last sentence should be:

A stack is a LAST-in first out ...
02/06/0
620 Error in Code Download
The code download for page 620 is different from what it in the book and is in error. In the Person.h file the line:

Person& operator=(const Person& p)const

Should be:

Person& operator=(const Person& p)



and the line:

bool operator<(const Person& p)

Should be:

bool operator<(const Person& p) const
03/10/09
665 Error in Code
The last line of the code snippet currently reads:
numbers.pushback(*numbersIn++);

Instead of "numbersIn" it should read "numbersInput."
05/23/2012
666 Error in Code
The last line of the code snippet at the top of the page currently reads:
accumulate(intvecRead, endStream, 0) >> endl;

'intvecRead' should read 'numbersInput'
'endStream' should be 'numbersEnd'

This has been corrected for the 2010 edition of this book.
05/23/2012
731 Error in Code
Default constructor (Name::Name) allocates a one-byte array so that the destructor can safely delete[] it.

However this is unnecessary provided the default constructor initialises the array members to 0. This is because the delete[] operator will do nothing if the pointer is null (0).
11/22/2010
761 Error in Figure
Figure 12-3 shows the method name

GetMessages()

but it should be

GetMessage()
01/03/10
13 789 Error in Figure 13-7
Figure 13-7 references an SDI application which does not need a child frame. Please see the downloads for this chapter to download the corrected figure.
07/21/08
817 Typo
just below the subtitle "Creating Menu Message Functions":
Highlight the CSketchDoc Class

should be:

Highlight the CSketcherDoc Class
10/03/08
827 Error in Text
This page says "...If you click the new button at the right end of the row as indicated, you?ll be able to draw this button."

This page should indicate a new button at the right end of a row.
5/15/2011
836 Error in Text
at the top left of the control

Should be:
at the top right of the control
10/03/08
840 Error in Text
When you select the Messages button

Should be

When you select the Events button
03/12/09
852 Typo in Text
In the section "The CDC Class," paragraph 3, the second line:

For example, you be using

Should be

For example, you will be using
6/26/09
864 Error in Text
the last mouse message:

WM_MOUSEMOVE | Message occurs when the button is moved

should be:
WM_MOUSEMOVE | Message occurs when the mouse is moved
07/23/08
878 Error in Figure 15-17
Figure 15-17, in the top half, the x-axis label:

Negative X-Axis

Should be

Positive X-Axis
2/10/09
926, 949, 954 Error in Code
In the code on page 949 for OnMouseMove, the first line after the gray text (the call to SetROP2) should not be there. It was moved to inside the if(m_pTempElement) block on page 926.
02/13/09
946 Typo in Text
In the table listing the flags for which button the pop-up tracks (just above the middle of the page), the flags are listed as TPM_LEFTMOUSEBUTTON and TPM_RIGHTMOUSEBUTTON.

They should be

TPM_LEFTBUTTON and TPM_RIGHTBUTTON.
02/13/09
954 Typo in Text
The first line after the code at the top of the page:

...to the CElements.cpp file...

Should be

...to the Elements.cpp file...
02/13/09
968 Missing Code
the Curve class Draw() function is missing some required things in order to draw a curve correctly. Only the book is missing the code. The book reads:

virtual void Draw(Graphics^ g) override
{
Point previous = Point(0, 0);
for each(Point p in points)
{
g->DrawLine(pen, previous, p);
previous = p;
}
}

this code works, but the curve is drawn starting off screen because the code to translate the coordinates is missing. The book should read:

virtual void Draw(Graphics^ g) override
{
g->TranslateTransform(safe_cast(position.X), safe_cast<float>(position.Y));
Point previous = Point(0, 0);
for each(Point p in points)
{
g->DrawLine(pen, previous, p);
previous = p;
}
g->ResetTransform();
}
07/23/08
1037 Error in Book Code
The downloadable code and the book differ here; the book version of the The penWidthButton_Click function is incorrect.

the book code for the penWidthButton_Click function should read:

private: System::Void penWidthButton_Click(System::Object^ sender, System::EventArgs^ e)
{
if(penDialog->ShowDialog() == System::Windows::Forms::DialogResult::OK)
{
penWidthComboBox->SelectedIndex = safe_cast<int>(penDialog->PenWidth - 1.0f);
penWidthComboBox->Invalidate();
}
}
07/25/08
1063 Typos
midpage, in the second marked code snippet:
typid

should be:
typeid ()

AND

typinfo

should be:
typeinfo

AND

for RTTI to work correctly:
typeid(m_pSelected)

should be:
typeid(*m_pSelected)
09/07/08