ERRATA

Microsoft Visual C++ 2005 Express Edition Programming

ISBN 1-59200-816-X

p.18“In The Real World”

Windows Forms Control Library does not appear as one of the standard templates

Windows Service does not appear as one of the standard templates

ASP.NET Service is not available in the Express Edition

p.20Step 2: Creating the User Interface

“Visual C++ provides an extensive list of controls, located in the Toolbox windows, which is displayed on the left side of the IDE.”

should read…

“Visual C++ provides an extensive list of controls, located in the Toolbox windows, which is displayed on the right side of the IDE.”

p.21Second paragraph below Figure 1.8

This paragraph makes reference to sizing the text box according to Figure 1.8. It should refer to Figure 1.9 on the following page.

p.25Step 5: Testing the Execution of the Joke Machine

“To build the project, select Build from the Build Solution menu”

should read…

“To build the project, select Build Solution from the Build menu”

p.42Toolbox Controls

The description of the “General” toolbox control is missing.

p.77Step #4

The location for the app.ico is confusing. The app.ico can be found in My Documents / Visual Studio 2005 / Projects / <project_name> / <project_name> directory.

p.84First paragraph

“(As you can see by the number of double semicolons…”

should read…

“(As you can see by the number of double colons…”

p.88In The Real World

It should be mentioned here that names are case-sensitive. This is covered later on in Chapter 5 (p.152) but the reader needs to understand this as he/she is typing in the code examples.

p.89Table 3.11 – footnote 1

“1You can find Icon.ico by default in the debug directory…”

should read…

“1You can find app.ico by default in the debug directory…”

The only problem with these instructions is that we have not yet built the code and so the debug directory does not yet exist.

p.96Example code

The following code is missing from the bottom of the page:

// Player is an expert!

if( intCount >= 5 )

{

intCount = 0;

intWrong = 0;

MessageBox::Show( "Game Complete. Your "

"typing skill level is: Expert! "

"Please play again!" );

}

p.105Figure 4.7

The Shortcut key is incorrectly labeled as an “Access key” in the figure.

p.136Example code

The following code is incorrect as it is missing multiple backslash characters

txtOutput->Text = String::Concat(

txtOutput->Text, Convert::ToString(

iLotteryArray[iCurPickCntr] ), "t" );

iCurPickCntr++;

} while( iCurPickCntr <

Int16::Parse( txtFullSet->Text) );

txtOutput->Text = String::Concat(

txtOutput->Text, "rrnrrn" );

}

it should read…

txtOutput->Text = String::Concat(

txtOutput->Text, Convert::ToString( \

iLotteryArray[iCurPickCntr] ), "\t" );

iCurPickCntr++;

} while( iCurPickCntr < \

Int16::Parse( txtFullSet->Text) );

txtOutput->Text = String::Concat( \

txtOutput->Text, "\r\r\n\r\r\n" );

}

The code example below is incorrect as it is missing a “s” on “Number”

clearNumberToolStripMenuItem->Enabled = true;

it should read…

clearNumbersToolStripMenuItem->Enabled = true;

“Adding Code to the Clear Numbers Menu Item” shows the function call as:

private: System::Void clearNumberToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)

{

}

it should read…

private: System::Void clearNumbersToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)

{

}

NOTE: The code downloaded from the publishers web site is also incorrect in that the person creating the code used the text “Clear Number” rather than “Clear Numbers” as per Table 4.6 on page 129.

p.147Table 5.1

Char data type range is incorrect. It should read -128 to 127

p.158Table 5.2

The last entry “String::TimeEnd” is incorrect. It should read “String::TrimEnd”

p.161Example code

The section of code that reads…

player.fAlive = true;

user.IDCode = 1000;

should read

player.fActive = true;

user.IDCode = 1000;

p.166Table 5.5

The “Name” property does not exist for Form1.

p.167 Table 5.7

button2 Text property is incorrectly indicated as “Introduction”. It should be “Instructions”

p.170 Example code

Line 4 of the code is missing backslash character. It reads:

“around her. n”

it should read…

“around her. \n”

p.172Example code

Line 12 of the code is missing two backslash characters. It reads:

"appeared an evil ", txbCreature->Text, ".nnThe ");

it should read…

"appeared an evil ", txbCreature->Text, ".\n\nThe ");

Line 25 of the code is missing two backslash characters. It reads:

txbRoom->Text, ".nn"

it should read…

txbRoom->Text, ".\n\n"

Line 33 of the code is missing two backslash characters. It reads:

"nnMighty Molly and the dreaded ",

it should read…

"\n\nMighty Molly and the dreaded ",

p.173Example code

Line 9 of the code is missing two backslash characters. It reads:

"fallen on during the fight.nn"

it should read…

"fallen on during the fight.\n\n"

Line 26 of the code is missing two backslash characters. It reads:

"William.nnThe End." );

it should read…

"William.\n\nThe End." );

p.182Example code

Example code has syntax errors. It is missing two semicolons. It reads:

Int32 intCount = 0;

If( intCounter == 0 )

{

intCounter += 1

MessageBox::Show(“The value of intCounter has been updated.” )

}

it should read…

Int32 intCount = 0;

If( intCounter == 0 )

{

intCounter += 1;

MessageBox::Show(“The value of intCounter has been updated.” );

}

p.192Steps 5 – 9

These instructions are ambiguous and will result in incorrect property changes being applied to the controls. In order to align with initial control names found in the Property Change tables, the instructions should read…

  1. Add a Label toward the top left of the second GroupBox and position a TextBox to the right of that same label. Add a Button control to the lower left-hand corner of the second GroupBox
  1. Add a Label in the center of the second GroupBox. Add a TextBox below this label and center it between the edges of the form
  1. Add a Button control below the last textbox and center it. Add a Label below the last button and center it.
  1. Add a TextBox below the last label and stretch it to the width of the second GroupBox.
  1. Add a Button control to the lower right-hand corner of the second GroupBox

p.193Table 6.3

The “Name” property does not exist for Form1.

The “Text” property does not match Figure 6.8. It should read “Guess A Number”.

Table 6.4

GroupBox1/Text property does not match Figure 6.8. It should read “Select A Range”.

p.196Table 6.9

The following is missing from the TextBox3 settings…

Property:MultilineValue:True

p.200Example code

Note: The code provided on the publisher’s website uses the variable name dblNoOfGuesses instead of dblPlayerGuess. This is the first variable declared on this page.

p.221Table 7.2

The “Name” property does not exist for Form1.

p.224Table 7.6

In order to be the same as the code provided on publisher’s website and the code example on page 238 Button2 Name property should be “btnExit” not “btnbreak”.

p.252Example code

The code for button1_Click is syntactically incorrect and will result in the following error message: error C2017: illegal escape sequence

The arguments for button1_Click that reads:

(System::Object^ sender, \ System::EventArgs^ e)

Should read…

(System::Object^ sender, System::EventArgs^ e)

p.255TimeSpan example

“In the case of this example, the specified date is November 11, 1964:”

should read…

“In the case of this example, the specified date is March 16, 1965:”

p.259Step 2: Creating the User Interface

1. Begin by clicking on the form and setting its Size property to 655, 412

Should read…

1. Begin by clicking on the form and setting its Size property to 540, 360

p.260Table 8.2

The “Name” property does not exist for Form1.

p.265Table 8.7

Label3/Text reads “No. of Guesses:” it should read “Guesses:”

p.293Table 9.3

PictureBox1/Name reads “pcbleft” it should read “pcbLeft”

p.324Table 10.4

The “Name” property does not exist for Form1.

The “Cursor” property reads “Crosshair” it should read “Cross”

p.348Table 11.2

The “Name” property does not exist for Form1.

p.349Table 11.4

PictureBox3 “Name” reads “pbxA2” it should read “pbxA3”

p.351Table 11.7

Missing - TextBox1 “MultiLine” property should be set true

The following instructions are missing

Change the name property for the ImageList control to imlSquares and add the following bitmap images to its Images property (collection) as shown below. You’ll find copies of the bitmap images require to complete this project, along with the source code, on this book’s companion Web site.

Images (Collection)[0] BlankSquare.bmp

[1] XSquare.bmp

[2] OSquare.bmp

p.363Last paragraph

The Switch_Players function, show next is straightforward.

It should read….

The SwapPlayerTurn function, show next is straightforward.

p.367, 369, 371

The header on each page reads “Chapter 1 • Getting Started with the WSH and VBScript”

It should read…

“APPENDIX B • What’s Next?”