Errata

Microsoft® Visual C#® 2008 Express Edition: Build a Program Now!

Errata for Microsoft® Visual C#® 2008 Express Edition: Build a Program Now!

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 51
the beginning/intro for Chapter 4 "Creating Your Own Web Browser in Less Than Five Minutes"

Page 51 of the beginning/intro for Chapter 4 "Creating Your Own Web
Browser in Less Than Five Minutes" the a list of sections that have wrong page numbers. See the following:

"What Is a Project?, 44" (should be 52)

"What Is the Design Layout?, 45" (should be 53)

"Putting It All Together, 52" (should be 60)

Anonymous  Jul 09, 2010 
Printed Page 86
line of code with a Text Box object

Chapter 5 has the following line of code with a Text Box object
misnamed:

"sw.WriteLine(this.txtMessage.Text);"

Should be:

"sw.WriteLine(this.tbMessage.Text;:"

Anonymous  Jul 09, 2010 
Printed Page 100
3rd paragraph, item number 1

"txtURL" is really tbURL, compare this with the table on page 57.

Michael O'Connor  May 29, 2011 
Printed Page 101
figure 6-7

About box version information shown on page 101 is not consistent with actual about box in running program. Source for this inconsistency is a bug (minor) in AboutBox.cs in the source code as delivered.

AboutBox.cs
was:
this.labelVersion.Text = String.Format("Version {0} {0}", AssemblyVersion);

now (corrected):
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);

Michael O'Connor  May 29, 2011 
Printed Page 124
Iten number 7

"right-click the globe.ico file in your Windows Form browser project..." is misleading, because the language seems to refer to the browser code (Windows Form browser project) loaded in solution explorer. The copy operation described will not work this way. It's really referring to the globe.ico file in the downloaded code sample package on the user's hard drive, which will allow the copy operation to work.

Michael O'Connor  May 29, 2011 
Printed Page 129
item number 6

Code will only work if the "using System.Windows.Controls" is commented out or deleted, because the code is referenced by "System.Windows.Forms" and "System.Windows.Controls", creating a compiling error. Page 128, item number 4, says to add "System.Windows.Forms" and "Windows.Forms.Integration" to the Browser.xaml.cs code, which resulted in a compile error when the code in item number 6 was added.

Michael O'Connor  May 30, 2011 
Printed Page 129
Step 6: Bottom of page.

From Chapter 6, Step 6:

private void NavigateToUrl(string Url)
{
WindowsFormsHost host = new WindowsFormsHost();
WebBrowser browserControl = new WebBrowser();

host.Child = browserControl;
this.grid1.Children.Add(host);
browserControl.ScrollBarsEnabled = true;
browserControl.Navigate(Url);
}

Error messages:
Error 1 'WebBrowser' is an ambiguous reference between 'System.Windows.Controls.WebBrowser' and 'System.Windows.Forms.WebBrowser H:\C#Programs\Chap6\MyOwnWpfBrowser\MyOwnWpfBrowser\MyOwnWpfBrowser\Browser.xaml.cs

Error 3 Cannot implicitly convert type 'System.Windows.Controls.WebBrowser' to 'System.Windows.Forms.Control' H:\C#Programs\Chap6\MyOwnWpfBrowser\MyOwnWpfBrowser\MyOwnWpfBrowser\Browser.xaml.cs

Larry H  Mar 04, 2012 
Printed Page 130
item number7, in the CancelButton_Click code.

Because code in C# is case-sensitive, the name "CancelButton_Click" should be "cancelButton_Click" (lower case "c"). Compare with XAML code on page 127, where "Click='cancelButton_Click'" is located near the end.

Michael O'Connor  May 30, 2011 
Printed Page 136
figure 7-3

The TestApplication.cs code in the DebuggingStart project, as delivered in the code sample, doesn't match the code in figure 7-3 on page 136. This is already a confirmed errata in the list submitted May 6, 2010, but this can still be remedied by the user if the code is changed to exactly match figure 7-3 (page 136), and rest of chapter 7 should work with no problems. There are only a couple of other things to change elsewhere, and page 145 contains the correct code to correct the errors that was supposed to be in TestApplication.cs code in the first place.

Follow these steps:
1. In TestApplication.cs, replace button1_Click method exactly as shown in figure 7-3, page 136. Place breakpoints where indicated.
2. Place breakpoints where indicated in figure 7-4, page 137.
3. As indicated in figure 7-8, page 142, in the ManipulateStrings method in Library.cs code, change "i = myString.Length - 1;" to say "i = myString.Length;". This introduces one of the bugs that chapter 7 narrative steers you into.
4. In the ReadFile method in Library.cs code, place a breakpoint where the line says "return content;", this is line 41.
5. Item number 5, page 141, "ReadToEnd" in italics should be "ReadFile" in italics.

The entire chapter 7 should run flawlessly after these changes are made. Pay attention to what chapter 7 says and what you're doing. I tested this and see no problem.

Michael O'Connor  May 30, 2011 
Printed Page 139
the brown caution box on the page margin

Caution box says, "The Edit and Continue feature doesn't work on 64-bit operating systems." It works on my 64-bit machine with 64-bit OS. The reason is because 32-bit programs will run on 64-bit machines on a 64-bit Vista OS. So this caution box may need to be reworded.

Michael O'Connor  May 30, 2011 
Printed Page 191
item number 1

The last line in the code is incorrect and will invoke a "NotImplementedException was Unhandled" compile error. In the last line, the code "filterByMake;" should be "filterByMake.ToList();"

Michael O'Connor  May 31, 2011 
Printed Page 192
item number 2

Same as above for "filterByCarType;"

Michael O'Connor  May 31, 2011 
Printed Page 215
Item number 1

Item 1 on the page begins with "Click, Add, New Project, and then..." There is no such "Add" menu item in Visual C# 2008, although there is an icon (not a menu item) below the menu bar that allows "Add New Item". But I don't think that's the intent of the author and it's not the same thing.

Michael O'Connor  Jun 05, 2011 
Printed Page 215
Item number 1

Item 1 on the page begins with "Click, Add, New Project, and then..." There is no such "Add" menu item in Visual C# 2008, although there is an icon (not a menu item) below the menu bar that allows "Add New Item". But I don't think that's the intent of the author and it's not the same thing.

Michael O'Connor  Jun 05, 2011 
Printed Page 215
Item number 1

Sorry, ignore the two previous entries made about page 215. This one is the corrected entry, I left out one word.

Item 1 on the page begins with "Click File, Add, New Project, and then..." There is no such "Add" menu item in Visual C# 2008, although there is an icon (not a menu item) below the menu bar that allows "Add New Item". But I don't think that's the intent of the author and it's not the same thing.

Michael O'Connor  Jun 05, 2011 
Printed Page 225
item number 4

The code in item number 4 mentions "Weather_Tracker". This should be "WeatherTracker" without the underscore.

Michael O'Connor  Jun 01, 2011 
Printed Page 225
item number 6

Typo in first line of code: "startBackgroungGetCurrentWeather()" should be startBackgroundGetCurrentWeather()" (note the "g").

Michael O'Connor  Jun 05, 2011 
Printed Page 240
first line on page

"Weather_Tracker.Properties" should be "WeatherTracker.Properties" (no underscore)

Michael O'Connor  Jun 02, 2011