Wrox Home  
Search

Topic: C# and C++

Professional C#, 3rd Edition (0764557599) cover image

Professional C#, 3rd Edition

Simon Robinson, Christian Nagel, Karli Watson, Jay Glynn, Morgan Skinner, Bill Evjen
ISBN: 978-0-7645-5759-0
Paperback
1224 pages
June 2004
View Previous Edition of This Title
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
xxvxii Text Error
"to understand and didn't make many programming tasks easy" should be "to understand and made many programming tasks easy"
10/7/04
xxvxiii Text Error
"... , Jave is not designed to work with the .NET environment." should be "... , Java was not designed to work with the .NET environment."
10/7/04
5 Text Error
"The pervious example qualifies as..."
Should be:
"The previous example qualifies as..."
6/8/05
8 Text Error
"In no way with COM did component written ..." should be "In no way did COM component written ..."
10/7/04
17 Text Error
"(indeed dynamic assemblies are stored in memory, not on file at all)." should be "(indeed dynamic assemblies are stored in memory, not in files at all)."
10/7/04
21 Text Error
"sometimes make development difficult" should be "sometimes makes development difficult"
10/7/04
27 Figure Error
In the figure, there is a missing line connecting the left "ASSEMBLY containing IL CODE" to the vertical line below "ASSEMBLY containing IL CODE" - but before the horizontal line connecting to the box ".NET base classes" -- since C# can also use these base classes. The line connecting the left "ASSEMBLY containing IL CODE" to the "CLR ORGANIZES" box should have been higher.
10/7/04
27 Text Error
"Garbage collector cleans up sources" should be "Garbage collector simplifies sources" since it can automatically clean out unused items.
10/7/04
32 Spelling/grammar
The line starts "Next, we declare a class ostensibly called MyFirstClass"
The class name is MyFirstCSharpClass, which is what is used in the previous page and lines following this line containing the error.
11/29/04
33 2nd paragraph
This refers to sentence 3: "In our case, we have have two modifiers: public and static."
Nowhere in the code blocks in the previous two pages has the 'public' access modifier been used. A person new to C# and without much of a programming background might get confused. Worse a C++ programmer would expect the access modifier for this method to be 'private' which is the default in C++ for methods and data. The access modifier should be 'public' for methods by default in Java.
11/29/04
37 Error in code in text
Location: Scope clashes for fields and local variables
Description: using System; namespace Wrox.ProCSharp.Basics { class ScopeTest2 { static int j = 20; public static void Main() { int j = 30; Console.WriteLine(j); return; } } }
10/13/04
47 Text Error
The syntax for the "if (condition) statement(s) else statement(s)" is wrong, it can only be "if (condition) statement | block else statement | block" since it can only be a single statement or a block of statement, which is the same as a single statement. This is clearly stated in the text below the shaded example.
10/7/04
48 1st code sample, Last else if block, "Newline in constant" error
The bad code is in the last else if block. There are two possible fixes:
1) The quoted string needs to be preceded by the @ symbol to allow it to span two lines, or
2) the top string needs to be properly terminated with double quotes and the string fragment remaining on the second line should be precedeeded by quotes so it can be properly concatenated to the first string with a plus (+) sign.
10/26/04
49 Error in example
In the 2nd shaded example, it should be "integerA ==1" rather than "integerA =1" -- as it reinforces the earlier example in the text just above "The switch statement".
10/7/04
51 Text Error
The syntax is wrong, it can only be one statement as the body of the for loop.
10/7/04
51 Text Error
"The condition is the expression that is checked before each new iteration of the loop" should be "The condition is the expression that is checked before each iteration of the loop"
10/7/04
51 Text Error
"and walk through the process again" should be "and repeat the process again"
10/7/04
52 Text Error
"which does the same as Console.WriteLine()" should be "which is similar to Console.WriteLine()"
10/7/04
53 Text Error
The syntax is wrong, it can only be a single statement in the body of the while loop.
10/7/04
55 Text Error
"since C#'s switch is so strict on fall-through." should be "since C#'s switch strictly prohibits fall-through."
10/7/04
56 Text Error
"TimeOfDay.Morning will return the value 0" should be "TimeOfDay.Morning is the value 0" -- as there is no evaluation! (it is simply a compile time constant)
10/7/04
60 Text Error
"... C# has no equivalent to C++ header files." is false, since you can (and should) use classes to do the equivalent (via "using").
10/7/04
62 Text Error
"However, when the program is invoked, we can get the CLR to pass any command line arguments to the program by including a parameter." should be "However, when the program is invoked, CLR passes any command line arguments to the program as a parameter."
10/7/04
76 Text Error
Text points out that it is a convention to prefix names of members fields with an underscore but the highlighted example has no underscore.
9/24/04
76 Private, Not Public
Test says "For names of all private member fields in types:"
But in the two following examples uses "public" instead of "private"
They should read "private"
4/5/05
77 Typo
fifth line on this page:
The pervious example

should say:
The previous example
11/19/2006
86 Text Error
"Operators are at their simplest are actions like" should be "Operators at their simplest are actions like"
10/7/04
92 Text Error
"wrong overload is called." should be "wrong overload method is called."
10/7/04
97 Text Error
"which constructor gets executed when." should be "which constructor is executed."
10/7/04
97 Text Error
"by Microsoft as part of the framework class library," should be "by Microsoft as part of the .NET framework class library,"
10/7/04
98 Text Error
There is a missing space after "Darwing.Color." and the start of the next sentence "DateTime implements ...".
10/7/04
98-99 Error in code in text
The code reads: public Car(string model, uint nWheels) { this.description = description; this.nWheels = nWheels; } It should read: public Car(string description, uint nWheels) { this.description = description; this.nWheels = nWheels; } - OR - public Car(string model, uint nWheels) { this.model = model; this.nWheels = nWheels; }
10/20/04
100 Text Error
"they are read-only, it cannot be assigned to outside the contructors" should be "they are read-only, the value cannot be assigned to outside the contructors"
10/7/04
101 Text Error
"of bringing in the heap with all the performance implications" should be "of allocating in the heap with all the performance implications"
10/7/04
107 Text Correction for page 107, 2nd paragraph
The correct code for the Money and BetterMoney classes: class Money { private decimal amount; public decimal Amount { get { return amount; } set { amount = value; } } } class BetterMoney : Money { public override string ToString() { return "$" + Amount.ToString(); } } And this is the correct code for the Main method: Money cash1 = new Money(); cash1.Amount = 40M; Console.WriteLine("cash1.ToString() returns: " + cash1.ToString()); cash1 = new BetterMoney(); cash1.Amount = 40M; Console.WriteLine("cash1.ToString() returns: " + cash1.ToString()); Running this code provides the following output to the console window: cash1.ToString() returns: Wrox.ProCSharp.OOCSharp.Money cash1.ToString() returns: $40
10/19/04
133 Text Error "-" should be "--"
Note that the decrementing operator is "--" that is two minus signs and not one, in both the text, the operator shortcuts table, and the precedence table.
10/7/04
134 Text Error "-" should be "--"
Note that the decrementing operator is "--" that is two minus signs and not one, in both the text, the operator shortcuts table, and the precedence table.
10/7/04
137 Text Error "-" should be "--"
Note that the decrementing operator is "--" that is two minus signs and not one, in both the text, the operator shortcuts table, and the precedence table.
10/7/04
139 Text Error
"if any are attepted" should be "if attepted"
10/7/04
168 Text Error
"write to the library exactly" should be "write the library exactly"
10/7/04
180 Text Error
"; however, there is no guarantee as to the order" should be "; as stated earlier, there is no guarantee as to the order"
10/7/04
181 Text Error
"There is a convention and for readability's sake it should be followed." should be "This convention is for readability's sake it should be followed."
10/7/04
182 Text Error
"write dependent code in the handlers" should be "write order dependent code in the handlers"
10/7/04
183 Text Error
"and the EventArgs class has been created." should be "and the ActionCancelEventArgs class has been created."
10/7/04
184 Text Error
The string should be "" and not :: in the line just above the shaded example box.
10/7/04
194 Text Error
"Another problem is that the implementation of a destructor delays" should be "Another problem is that the C# implementation of a destructor delays"
10/7/04
218 Missing quotations in code
The line of code

char char4 = message[4];

on page 218 should be replaced with

char char4 = "message"[4];
2/9/05
468 Error in Code
code block:
if (channel is HttpChannel)

should be:
if (channel is HttpServerChannel)

AND

HttpChannel httpChannel = channel as HttpChannel;

should be:
HttpServerChannel httpChannel = channel as HttpServerChannel;
10/24/06
16 469-70 Error in Window
page 469 + page 470 windows
Name: http

should be:
Name: http server

AND

After the 'Priority: 1' line should be another line: 'Schema: http'.
10/24/06
605 Error in Text
First Paragraph:

"Most of these are self-explanatory with the exception of the two tool window borders. A tool window will not appear in the taskbar, regardless of how ShowInTaskBar is set. Also a Tool window will not show in the list of windows when the user presses Alt-Tab. The default setting is Sizeable."

should be changed to:

"Most of these are self-explanatory with the exception of the two tool window borders. A Tool window will not show in the list of windows when the user presses Alt-Tab. The default setting is Sizeable."

The second sentence is wrong and will have to be removed.
1/05/06
898 Error in Code
The code at the bottom starts the function as:

protected void calendar_DayRender(obje...
Although in the downloaded source code it is:
private void calendar_DayRender(obje...

"protected" should be the right one, not "private".
7/6/05
901 Missing Line
The code examples at the bottom are missing the following line:

protected System.Web.UI.WebControls.DataGrid eventDetails1;
Which should go under:
public class WebForm1 : System.Web.UI.Page

This is correct in the downloadable source code.
7/6/05
924 Error in 2nd AddEvent Parameter (roomList.SelectedItem.Value)
Easiest thing to do is to change the client as follows: int queryResult = dataService.AddEvent(eventBox.Text, roomList.SelectedItem.Value.ToString(), attendees,dateString); And the web service as follows (remove two 's): String oleDbCommand = "INSERT INTO Events (Name, Room, AttendeeList, EventDate) VALUES ('" + eventName + "', " + eventRoom + ", '" + eventAttendees + "', '" + eventDate + "')"; Even better is to do it the way it's done in the new version, starting with: String oleDbCommand = "INSERT INTO Events (Name, Room, AttendeeList, EventDate) VALUES (@Name, @Room, @AttendeeList, @EventDate)"; Then add parameters to the command - this has the added bonus of preventing SQL insertion attacks.
12/7/04
28 975 error in text
second to last line:
dual, helpstring("ICOMDemo Interface"),

should be:
dual, helpstring("IWelcome Interface"),
10/24/06
28 977 Information Lacking
When building the component I received errors that there were no member function declarations for the Add and Sub member functions. Within the text it is not explained that these two member function declarations should be added to the COMDemo.h file.
10/24/06
28 979 Error in Second Code Block
second code block:
Console.WriteLine(obj.Greeting("Christian"));

should be:
Console.WriteLine(welcome.Greeting("Christian"));
10/24/06
28 979 Error in Fourth Code Block
fourth code block:
Marshal.ReleaseComObject(math);

should be:
Marshal.ReleaseComObject(obj);
10/24/06
1162 Error in text
"This determination of which overload should be called..." should read: "This determination of which override should be called..."
12/6/04
All Text Correction throughout book/all pages
All of the keywords beginning with the letter i are capitalized.
This is incorrect: interface not Interface etc.
10/19/04
All Text Correction throughout book/all pages (page All)
Multiplication sign is rendered as an underscore, for example in ±1.5 x 10^-45 ("one point five times 10 to the minus 45").
10/19/04
Printer-Ready Version   Share This
With you wherever you go: pdf + ePub + kindle -- DRM-free

Bonus Material