Microsoft KB Archive/323147

= Applied Microsoft .NET Framework Programming Comments and Corrections =

Article ID: 323147

Article Last Modified on 1/15/2007

-

APPLIES TO


 * MSPRESS Applied Microsoft .NET Framework Programming ISBN 0-7356-1422-9

-



This article was previously published under Q323147



SUMMARY
This article contains comments, corrections, and information about known errors relating to the Microsoft Press book Applied Microsoft .NET Framework Programming, ISBN 0-7356-1422-9.

The following topics are covered:


 * Page xxviii: Incorrect &quot;And&quot; In Lead-In
 * Page xxxi: Invalid URL
 * Page 10: MSCorLib.dll Should Be MSCorEE.dll in Diagram 1-3
 * Page 11: Standard Edition Should Be Second Edition
 * Page 14: Invalid URL
 * Page 19: System.Security.Verifier.Exception Should Be System.Security.VerificationException
 * Page 20: Verifier Should Be Verification
 * Page 27: CTS And CLR Should Be CLS
 * Page 28: Missing Text
 * Page 68: Standard Edition Should Be Second Edition
 * Page 77: AssemblyAlgIDAttribute Should Be AssemblyAlgorithmidAttribute
 * Page 78: Incorrect Build Number
 * Page 81: Bad Breaks In Listing
 * Page 92: Error In Code Sample
 * Page 107: Policy.1.0.MyAsm.dll Should Be Policy.1.0.JeffTypes.dll
 * Page 110: Standard Should Be Second
 * Page 116: Incorrect Statement Regarding MemberwiseClone
 * Page 119: public void Should Be public static void
 * Page 121: Incorrect Table Number
 * Page 121: Correction To Table Items
 * Page 123: Complier Should Be Compiler
 * Page 126: System.Collections.StringCollections Should Be System.IO.FileSystemWatcher
 * Page 126: System.Collections.ArrayList Should Be System.IO.FileStream
 * Page 126: Correction To Sentence
 * Page 129: Int64 Should Be Int32
 * Page 129: Correction To Sentence
 * Page 129: BinaryRead Should Be BinaryReader
 * Page 130: Int64 Should Be Int16
 * Page 135: ValueType Should Be System.ValueType
 * Page 138: Missing &quot;Is&quot;
 * Page 140: InteropService Should Be Pluralized
 * Page 141: Array Should Be ArrayList
 * Page 141: void Should Be Int32
 * Page 142: Stack-base Should Be Stack-Based
 * Page 144: Missing Semicolon
 * Page 152: p Should Be p2
 * Page 155 & 157: Correction To Code Sample
 * Page 160: Capital &quot;I&quot; Needed
 * Page 166: Correction To Code Sample
 * Page 176: Incorrect Descriptions In Table 7-4
 * Page 177: MaxInt32 Should Be MaxInt16
 * Page 179: Disregard Note Box
 * Page 180: Correction To Code Sample
 * Page 180: type's Should Be class's
 * Page 186: Correction To Error Text
 * Page 188: Disregard Portion Of Sentence
 * Page 199: 2.5 Should Be 2.5F
 * Page 202: Initialize Should Be Initialized
 * Page 204: Void Should Be Static Void
 * Page 204: ProcessingFiles Should Be ProcessFiles
 * Page 206: Void Should Be Static Void
 * Page 218: Missing Word
 * Page 219: Delete Closing Brace
 * Page 220: Delete Parenthesis
 * Page 220: Correction To Code Listing
 * Page 221: foreach Should Be for
 * Page 222: Missing Word
 * Page 223: Changes To Code Listing
 * Page 230: Final Paragraph Should Be Part Of Note Box
 * Page 232: Missing &quot;virtual&quot;
 * Page 232: Missing &quot;virtual&quot;
 * Page 234: Transposed Text In Code Listing
 * Page 236: Brace Should Be Parenthesis
 * Page 273: Correction To Table 12-4
 * Page 273: Correction To Table 12-4
 * Pages 283-284: Replace Code Listing
 * Page 284: Doesn't Should Be Does
 * Page 302: Error In Code Sample
 * Page 302: Missing Semicolon In Code Sample
 * Page 303: Correction To Code Listing
 * Page 310: Section Should Be Chapter
 * Page 326: Error In Code Sample
 * Page 328: this Should Be other In Code Listing
 * Page 334: Second Should Be Fourth
 * Page 337: Error In Code Sample
 * Page 339: private Should Be protected
 * Page 340: private Should Be protected
 * Page 341: Error In Sample Code
 * Page 346: Incorrect Capitalization In Code Sample
 * Page 348: Error In Text
 * Page 355: Remove &quot;and&quot;
 * Page 361: Error In Code Sample
 * Page 369: Error In Code Sample
 * Page 374: Correction To Code Listing
 * Page 374: Correction To Code Sample
 * Page 374: Correction To Code Sample
 * Page 378: Error In Code Sample
 * Page 378: Errors In Code Sample
 * Page 381: Missing Parenthesis In Code Sample
 * Page 383: FeedbackToStream Should Be FeedbackToFile
 * Page 438: Error In Table 18-2
 * Page 459: Error In Code Sample
 * Page 473: &quot;would&quot; Should Be &quot;should&quot;
 * Page 473: &quot;wouldn't&quot; Should Be &quot;would&quot;
 * Page 477: &quot;didn't&quot; Should Be &quot;did&quot;
 * Page 491: Error In Code Sample
 * Page 492: Missing } Bracket In Code Sample
 * Pages 496 & 497: &quot;J&quot; Should Be &quot;K&quot;
 * Page 500: Error In Code Sample
 * Page 523: Delete &quot;second version&quot;
 * Page 535: Incorrect Version Statement
 * Page 537: RunTime Should Be RuntimeType
 * Page 539: Error In Table 20-3
 * Page 547: Incorrect Text In Important Box
 * Page 553: Incorrect Statement
 * Page 553: Incorrect Text



Page xxviii: Incorrect &quot;And&quot; In Lead-In
In the lead-in line (in boldface) of the second entry on the page, remove the &quot;and&quot;.

Change:

&quot;Automatic memory and management (garbage collection)&quot;

To:

&quot;Automatic memory management (garbage collection)&quot;

Page xxxi: Invalid URL
There is an invalid URL listed in the last sentence in the first paragraph of the 'System Requirements' section on page xxxi.

Change:

&quot;You can download it from http://go.microsoft.com/fwlink/?LinkId=5584.&quot;

To:

&quot;You can download it from http://msdn2.microsoft.com/en-us/netframework/aa731542.aspx&quot;

Page 10: MSCorLib.dll Should Be MSCorEE.dll in Diagram 1-3
On page 10, in figure 1-3, an incorrect DLL is referenced.

Change the box currently reading:

&quot;DLL:MSCorLib.dll

Function:_CorExeMain&quot;

To:

&quot;DLL:MSCorEE.dll

Function:_CorExeMain&quot;

Page 11: Standard Edition Should Be Second Edition
On page 11, in the first sentence of the third paragraph,

Change:

&quot;[...] Windows 98 Standard Edition [...]&quot;

To:

&quot;[...] Windows 98 Second Edition [...]&quot;

Page 14: Invalid URL
There is an invalid URL listed in the last sentence in the second to last paragraph on page 14.

Change:

&quot;For more information about ECMA, see http://www.ECMA.ch and http://MSDN.Microsoft.com/Net/ECMA.&quot;

To:

&quot;For more information about ECMA, see http://www.ecma-international.org/ and http://MSDN.Microsoft.com/Net/ECMA.&quot;

Page 19: System.Security.Verifier.Exception Should Be System.Security.VerificationException
In the last sentence on page 19,

Change:

&quot;[...] System.Security.Verifier.Exception [...]&quot;

To:

&quot;[...] System.Security.VerificationException [...]&quot;

Page 20: Verifier Should Be Verification
On page 20, in the box titled &quot;Is Your Code Safe?&quot;, in last sentence of the third paragraph,

Change:

&quot;[...] VerifierException [...]&quot;

To:

&quot;[...] VerificationException [...]&quot;

Page 27: CTS And CLR Should Be CLS
On page 27, in the second sentence of the fourth paragraph, there is a reference to &quot;CTS&quot; and a reference to &quot;CLR&quot;. Both of these should read &quot;CLS&quot;.

Page 28: Missing Text
On page 28, the next to last sentence of the third paragraph is missing some words. Change:

&quot;The second error is because this type exposes two public methods that differ only by case: Abc and abc.&quot;

To:

&quot;The second error is because this type exposes two public methods that differ only by case and return type: Abc and abc.&quot;

Page 68: Standard Edition Should Be Second Edition
On page 68, in the first paragraph, change the reference to &quot;Windows 98 Standard Edition&quot; to &quot;Windows 98 Second Edition&quot;.

Page 77: AssemblyAlgIDAttribute Should Be AssemblyAlgorithmidAttribute
At the top of page 77, change &quot;System.Reflection.AssemblyAlgIDAttribute&quot; to &quot;System.Reflection.AssemblyAlgorithmIdAttribute&quot;.

Note there are two changes--ID becomes Id, and Alg becomes Algorithm.

Page 78: Incorrect Build Number
On page 78, in the listing AssemblyRef #1,

Change:

&quot;Build Number: 0x0000c1e&quot;

To:

&quot;Build Number: 0x0000ce4&quot;

Page 81: Bad Breaks In Listing
On page 81, there are two bad breaks in the listing.

Change: /ur Uninstalls an assembly reference. Include the name of the assembly, type of reference, ID and data as parameters. Example: / ur myDLL.Version=1.1.0.0,Culture=en.PublicKeyToken=874e23ab874e23ab FILEPATH c:\apps\myapp.exe MyApp To: /ur Uninstalls an assembly reference. Include the name of the assembly, type of reference, ID and data as parameters. Example: /ur myDLL.Version=1.1.0.0,Culture=en. PublicKeyToken=874e23ab874e23ab FILEPATH c:\apps\myapp.exe MyApp

Change: /uf Forces uninstall of an assembly by removing all install references. Include the full name of the assembly to remove as a parameter. Assembly will be removed unless referenced by Windows Installer. Example: / uf myDLL.Version=1.1.0.0,Culture=en.PublicKeyToken=874e23ab874e23ab To: /uf Forces uninstall of an assembly by removing all install references. Include the full name of the assembly to remove as a parameter. Assembly will be removed unless referenced by Windows Installer. Example: /uf myDLL.Version=1.1.0.0,Culture=en. PublicKeyToken=874e23ab874e23ab

Page 92: Error In Code Sample
The second attribute of Step 1 on page 92 is incorrect.

Change:

[assembly:DelaySign(true)]

To:

[assembly:AssemblyDelaySign(true)]

Page 107: Policy.1.0.MyAsm.dll Should Be Policy.1.0.JeffTypes.dll
On page 107, in the bulleted paragraph &quot;The /out switch&quot;,

Change:

&quot;[...] Policy.1.0.MyAsm.dll [...]&quot;

To:

&quot;[...] Policy.1.0.JeffTypes.dll [...]&quot;

Page 110: Standard Should Be Second
On page 110, in the Note box, change the reference to &quot;Windows 98 Standard Edition&quot; to &quot;Windows 98 Second Edition&quot;.

Page 116: Incorrect Statement Regarding MemberwiseClone
There is an error in the first sentence in the Description column for the MemberwiseClone Protected Method row of the System.Object class table located towards the bottom of Page 116.

Change:

&quot;This nonvirtual method creates a new instance of the type and sets the new object's fields to be identical to this object's fields.&quot;

To:

&quot;This nonvirtual method creates a new instance of the type and sets the new object's nonstatic fields to be identical to this object's nonstatic fields.&quot;

Page 119: public void Should Be public static void
On page 119, in the first line of the listing,

Change:

public void PromoteEmployee(Object o) { ...

To:

public static void PromoteEmployee(Object o) { ...

Page 121: Incorrect Table Number
On page 121, in the Table &quot;Type-Safety Quiz&quot;, change the table number from &quot;4-4&quot; to &quot;4-3&quot;.

Page 121: Corrections To Table Items
On page 121, in the table &quot;Type-Safety Quiz&quot;, there are three incorrect lines.

On line 10, change:

&quot;B b3 = d1;&quot;

To:

&quot;B b4 = d1;&quot;

On line 15, change:

&quot;B b4 = (B) o1;&quot;

To:

&quot;B b5 = (B) o1;&quot;

On line 16, change:

&quot;B b5 = (D) b2;&quot;

To:

&quot;B b6 = (D) b2;&quot;

Page 123: Complier Should Be Compiler
On page 123, in the second sentence of the second paragraph, change &quot;complier&quot; to &quot;compiler&quot;.

Page 126: System.Collections.StringCollections Should Be System.IO.FileSystemWatcher
On page 126, in the first paragraph of &quot;How Namespaces and Assemblies Relate&quot; change &quot;System.Collections.StringCollections&quot; to &quot;System.IO.FileSystemWatcher&quot;

Page 126: System.Collections.ArrayList Should Be System.IO.FileStream
On page 126, in the first paragraph of &quot;How Namespaces and Assemblies Relate&quot; change &quot;System.Collections.ArrayList&quot; to &quot;System.IO.FileStream&quot;

Page 126: Correction To Sentence
On page 126, in the box &quot;How Names and Assemblies Relate&quot;, change the final line of the third paragraph from:

&quot;[...] source code and you'd use the /r:System.Windows.dll compiler switch.&quot;

To:

&quot;[...] source code and use the /r:System.Windows.Forms.dll compiler switch.&quot;&quot;

Page 129: Int64 Should Be Int32
On page 129, in the second bulleted item, third line, change &quot;Int64&quot; to &quot;Int32&quot;.

Page 129: Correction To Sentence
On page 129, in the third bulleted item, change the first sentence:

&quot;[...] that have type names in the method.&quot;

To:

&quot;[...] that have type names as part of their method names.&quot;

Page 129: BinaryRead Should Be BinaryReader
On page 129, in the listing in the third bulleted item,

Change:

BinaryReader br = new BinaryRead(...); ...

To:

BinaryReader br = new BinaryReader(...); ...

Page 130: Int64 Should Be Int16
There are two instances of Int64 that should be changed to Int16.

Change:

&quot;converting from Single to Int64 requires a cast because Single can represent numbers of a larger magnitude than Int64 can.&quot;

To:

&quot;converting from Single to Int16 requires a cast because Single can represent numbers of a larger magnitude than Int16 can.&quot;

Page 135: ValueType Should Be System.ValueType
On page 135, in the third paragraph, last sentence (above the Note box), change the final word &quot;ValueType&quot; to &quot;System.ValueType&quot;.

Page 138: Missing &quot;Is&quot;
On page 138, in the second sentence,

Change:

&quot;[...] C# thinks the instance initialized [...]&quot;

To:

&quot;[...] C# thinks the instance is initialized [...]&quot;

Page 140: InteropService Should Be Pluralized
On page 140, in the box &quot;How the CLR Controls the Layout of a Type's Fields&quot;, in the example at the bottom,

Change:

using System; using System.Runtime.InteropService; ...

To:

using System; using System.Runtime.InteropServices; ...

Page 141: Array Should Be ArrayList
On page 141, in the code example,

Change:

...     a.Add(p);        //Box the value type and add the // reference to the Array. ...

To:

...     a.Add(p);        //Box the value type and add the // reference to the ArrayList. ...

Page 141: void Should Be Int32
On page 141, after the second paragraph is a code snip for the Add method,

Change: public virtual void Add(Object value);

To: public virtual Int32 Add(Object value);

Page 144: Missing Semicolon
On page 144, in the code example,

Change: ...  o = p }

To: ...  o = p; }

Page 152: p Should Be p2
On page 152, in the third bulleted item, change the first two references to &quot;p&quot; to &quot;p2&quot;.

Pages 155 & 157: Correction To Code Sample
On pages 155 and 157, approximately middle of each page,

Change: // Optional overloads of the == and != operators public static Boolean operator==(MyRefType o1, MyRefType o2) { if (ol == null) return false; return ol.Equals(o2); }

To: // Optional overloads of the == and != operators public static Boolean operator==(MyRefType o1, MyRefType o2) { return Object.Equals(o1, o2); }

Page 160: Capital &quot;I&quot; Needed
On page 160, under &quot;Summary of Implementing Equals and the ==/!= Operators&quot;, in the first bulleted item, references to &quot;Uint16&quot;, &quot;Uint32&quot;, &quot;Uint64&quot; all need the &quot;i&quot; capitalized so they read: &quot;UInt16&quot;, &quot;UInt32&quot;, &quot;UInt64&quot;

Page 166: Correction To Code Sample
On page 166, in the first code sample,

Change: ...     // Refer to a deep copy of the set passed. this.set = set.Clone;

To: ...     // Refer to a shallow copy of the set passed. this.set = (ArrayList) set.Clone;

Page 176: Incorrect Descriptions In Table 7-4
There are multiple errors in the description column of Table 7-4.

In the Newslot row, change:

&quot;Method should not override a virtual method ... Applies only to virtual methods.&quot;

To:

&quot;Method should not override an instance method ... Applies only to instance methods.&quot;

In the Override row, change:

&quot;Applies only to virtual methods.&quot;

To: &quot;Applies only to derived methods.&quot;

In the Final row, change:

&quot;Applies only to virtual methods.&quot;

To:

&quot;Applies only to derived methods.&quot;

Page 177: MaxInt32 Should Be MaxInt16
On page 177, on the last line, change &quot;MaxInt32&quot; to &quot;MaxInt16&quot;.

Page 179: Disregard Note Box
On page 179, disregard the Note Box at the top of the page.

Page 180: Correction To Code Sample
On page 180, in the code sample,

Change: ... // This is an instance read-only field. public String readonly pathName = &quot;untitled&quot;;

To: ... // This is an instance read-only field. public readonly String pathName = &quot;untitled&quot;;

Page 180: type's Should Be class's
On page 180, in the final paragraph,

Change:

&quot;[...] to initialize a type's constants, [...]&quot;

To:

&quot;[...] to initialize a class's constants, [...]&quot;

Page 186: Correction To Error Text
On page 186, in the second paragraph after the Note box,

Change:

&quot;[...] produces the following: &quot;error CS0573: 'SomeType.x': [...]&quot;

To:

&quot;[...] produces the following: &quot;error CS0573: 'SomeValType.x': [...]&quot;

Page 188: Disregard Portion Of Sentence
On page 188, in the third paragraph, disregard:

&quot;(or process if the assembly is loaded in a domain neutral fashion)&quot;

Page 199: 2.5 Should Be 2.5F
On page 199, in the code example, change: Rational r2 = 2.5;  // Implicit cast from Single to Rational To:

Rational r2 = 2.5F; // Implicit cast from Single to Rational

Page 202: Initialize Should Be Initialized
On page 202, in the upper code example, change: v += 10; // This method can use the initialize value in v. To: v += 10; // This method can use the initialized value in v.

Page 204: Void Should Be Static Void
On page 204, in the first code example, there are two lines beginning with the word &quot;void&quot; that need to be changed.

Change:

void StartProcessingFiles(out FileStream fs) { To:

static void StartProcessingFiles(out FileStream fs) {

Change:

void ContinueProcessingFiles(ref FileStream fs) { To:

static void ContinueProcessingFiles(ref FileStream fs) {

Page 204: ProcessingFiles Should Be ProcessFiles
On page 204, in the third to last line at the bottom of the page,

Change:

void ProcessingFiles(ref FileStream fs) {

To:

void ProcessFiles(ref FileStream fs) {

Page 206: Void Should Be Static Void
On page 206, in the code sample, change:

void GetAnObject(out Object o) { To:

static void GetAnObject(out Object o) {

Page 218: Missing Word
On page 218, the word &quot;method&quot; is missing in the first two bulleted items.

In the first bullet, change:

&quot;...define a get accessor for the property.&quot;

To:

&quot;...define a get accessor method for the property.&quot;

In the second bullet, change:

&quot;...define a set accessor for the property.&quot;

To:

&quot;...define a set accessor method for the property.&quot;

Page 219: Delete Closing Brace
The code sample on page 219 contains one closing brace too many. The code sample should read as follows: public void set_Age(Int32 value) { If (value < 0)    // The 'value always identifies the new value. throw new ArgumentOutOfRangeExceptional(   &quot;Age must be greater than or equal to 0&quot;); _Age = value; } }

Page 220: Delete Parenthesis
On page 220, in the code listing, next to last line, remove the final parenthesis.

Change: return (byteArray[bitPos / 8] & (1 << (bitPos % 8 ))) != 0);

To: return (byteArray[bitPos / 8] & (1 << (bitPos % 8 ))) != 0;

Page 220: Correction To Code Listing
On page 220, in the second section of the code listing, there is missing text.

Change:

if (numBits <= 0) throw new ArgumentOutOfRangeException(&quot;numBits must be > 0&quot;);

To:

if (numBits <= 0) throw new ArgumentOutOfRangeException(&quot;numBits&quot;,        &quot;numBits must be > 0&quot;);

Page 221: foreach Should Be for
In the third section of the code listing after the sentence &quot;Using the BitArray type's indexer...&quot;, the word &quot;foreach&quot; should be &quot;for&quot;.

Change: // Show the state of all the bits by calling the get accessor. foreach (Int32 x = 0; x < 14; x++) {

To: // Show the state of all the bits by calling the get accessor. for (Int32 x = 0; x < 14; x++) {

Page 222: Missing Word
On page 222, the word &quot;method&quot; is missing in the first two bulleted items.

In the first bullet, change:

&quot;...define a get accessor for the property.&quot;

To:

&quot;...define a get accessor method for the property.&quot;

In the second bullet, change:

&quot;...define a set accessor for the property.&quot;

To:

&quot;...define a set accessor method for the property.&quot;

Page 223: Changes To Code Listing
On page 223, in the second code listing, there are three errors. On the first line, the words &quot;SomeType&quot; should be &quot;BitArray&quot;, on the second line the word &quot;as&quot; should be capitalized, on the eighth line &quot;cs.Bit(2)&quot; should be &quot;ba.Bit(2)&quot;.

Change: ' Construct an instance of the SomeType type. Dim ba as new BitArray(10) ' Visual Basic uses instead of [ ] to specify array elements. Console.WriteLine(ba(2))         'Displays True or False

'Visual Basic also allows you to access the indexer by its name. Console.WriteLine(cs.Bit(2))   'Displays same as previous line NOTE: While not shown in the code samples here, the vertical ellipsis shown in the book should be retained.

To: ' Construct an instance of the BitArray type. Dim ba AS new BitArray(10) ' Visual Basic uses instead of [ ] to specify array elements. Console.WriteLine(ba(2))         'Displays True or False

'Visual Basic also allows you to access the indexer by its name. Console.WriteLine(ba.Bit(2))   'Displays same as previous line

Page 230: Final Paragraph Should Be Part Of Note Box
On page 230, the final paragraph, beginning &quot;As you can see, this type is nothing to write home about.&quot;, should be part of the Note box immediately above it.

Page 232: Missing &quot;virtual&quot;
On page 232, the word &quot;virtual&quot; is missing from the second section of the code listing.

Change: // 2. A PUBLIC add_* method //     Allows objects to register interest in the event. [MethodImplAttribute(MethodImplOptions.Synchronized) ] public void add_MailMsg(MailMsgEventHandler handler) {

To: // 2. A PUBLIC add_* method //     Allows objects to register interest in the event. [MethodImplAttribute(MethodImplOptions.Synchronized) ] public virtual void add_MailMsg(MailMsgEventHandler handler) {

Page 232: Missing &quot;virtual&quot;
On page 232, the word &quot;virtual&quot; is missing from the third section of the code listing.

Change: // 3. A PUBLIC remove_* method //     Allows objects to unregister interest in the event. [MethodImplAttribute(MethodImplOptions.Synchronized) ] public void remove_MailMsg(MailMsgEventHandler handler) {

To: // 3. A PUBLIC remove_* method //     Allows objects to unregister interest in the event. [MethodImplAttribute(MethodImplOptions.Synchronized) ] public virtual void remove_MailMsg(MailMsgEventHandler handler) {

Page 234: Transposed Text In Code Listing
On page 234, in the code listing, in the 26th line, the text is transposed.

Change: &quot;To:         {0} \n               From: {1} \n      Subject: {2} \n              Body:                {3} \n&quot;

To: &quot;From:      {1} \n               To:    {0} \n       Subject: {2} \n              Body:                {3} \n&quot;

Page 236: Brace Should Be Parenthesis
On page 236, change the code example near the top of the page from: mm.remove_MailMsg(callback] ;

To: mm.remove_MailMsg(callback) ;

Page 255: .SubString Should Be .Substring
On page 255, in the final code snip, &quot;.SubString&quot; should be &quot;.Substring&quot;

Change: if (s.ToLower.SubString(10, 20).EndsWidth(&quot;exe&quot;)) {

To: if (s.ToLower.Substring(10, 20).EndsWidth(&quot;exe&quot;)) {

Page 273: Correction To Table 12-4
On page 273, in table 12-4, the entry for Member Type for Member Length is incorrect.

Change:

&quot;Read only property&quot;

To:

&quot;Read/write property&quot;

Page 273: Correction To Table 12-4
On page 273, in table 12-4, the entry for Member AppendInsert should be broken into 2 separate lines.

Change:

&quot;AppendInsert&quot;

To:

&quot;Append

Insert&quot;

Pages 283-284: Replace Code Listing
On page 283, replace the code listing beginning at the bottom third of the page (first line: &quot;public StringBuilder AppendFormat(IFormatProvide formatProvider&quot;) and continuing on to page 284, with the following: public StringBuilder AppendFormat(IFormatProvider formatProvider, String format, params Object[] args) {

// If an IFormatProvider was passed, find out // whether it offers an ICustomFormatter object. ICustomFormatter cf = null; if (formatProvider != null) cf = (ICustomFormatter) formatProvider.GetFormat(typeof(ICustomFormatter));

// Keep appending literal characters (not shown in this pseudocode) // and replaceable parameters to the StringBuilder's character array. while (MoreReplaceableArgumentsToAppend) { // argFormat refers to the replaceable format string obtained // from the format parameter String argFormat = ...;

// argObj refers to the corresponding element // from the args array parameter Object argObj = ...; // argStr will refer to the formatted string to be appended // to the final, resulting string String argStr = null;

// If a custom formatter is available, let it format the argument. if (cf != null) argStr = cf.Format(argFormat, argObj, formatProvider);

// If there is no custom formatter or if it didn't format // the argument, try something else. if (argStr == null) { // Does the argument's type support rich formatting? IFormattable formattable = argObj as IFormattable; if (formattable != null) { // Yes; pass the format string and provider to           // the type's IFormattable ToString method. argStr = formattable.ToString(argFormat, formatProvider); } else { // No; get the general format using // the thread's culture information. if (argObj != null) argStr = argObj.ToString; else argStr = String.Empty; }     }      // Append argStr's characters to the character array field member. ...  }   return this; }

Page 284: Doesn't Should Be Does
On page 284, in the second paragraph after the code listing, change:

&quot;If the object doesn't support IFormattable, [...]&quot;

To:

&quot;If the object does support IFormattable, [...]&quot;

Page 302: Error In Code Sample
There is an error in the code sample at the top of page 302.

Change:

&quot;Console.WriteLine(c.ToString(&quot;X&quot;)); // &quot;2&quot; (heX format)&quot;

To:

&quot;Console.WriteLine(c.ToString(&quot;X&quot;)); // &quot;00000002&quot; (heX format)&quot;

Page 302: Missing Semicolon In Code Sample
There is a semicolon missing from a code sample on page 302.

Change:

&quot;Console.WriteLine(Enum.Format(typeof(Color), 2, &quot;G&quot;))&quot;

To:

&quot;Console.WriteLine(Enum.Format(typeof(Color), 2, &quot;G&quot;));&quot;

Page 303: Correction To Code Listing
On page 303, in the code listing, second line from the top, change:

&quot;Console.WriteLine(&quot;{0,5:D}\t{1:G}&quot;,c, c); &quot;

To:

&quot;Console.WriteLine(&quot;{0,5:D}\t{0:G}&quot;,c); &quot;

Page 310: Section Should Be Chapter
On page 310, change the very last word on the page, &quot;section&quot;, to &quot;chapter&quot;.

Page 326: Error In Code Sample
There is an error in the code sample at the bottom of page 326.

Change:

&quot; Int32 CompareTo(Object object);&quot;

To:

&quot; Int32 CompareTo(Object obj);&quot;

Page 328: this Should Be other In Code Listing
On page 328, in the code listing, third section, change:

return (x == this.x) && (y == this.y) To:

return (x == other.x) && (y == other.y)

Page 334: Second Should Be Fourth
There is an error near the end of the second paragraph on page 334.

Change:

&quot;When WriteLine is called the second time,&quot;

To:

&quot;When WriteLine is called the fourth time,&quot;

Page 337: Error In Code Sample
There is an error in the code sample at the bottom of page 337.

Change:

menu = gp.GetMenu); To:

menu = gp.GetMenu;

Page 339: private Should Be protected
On page 339, in the code listing, change:

&quot;// NOTE: No public/private used on the next line &quot;

To:

&quot;// NOTE: No public/protected used on the next line &quot;

Page 340: private Should Be protected
On page 340, in the third and fourth paragraph, and in the sample errors between these paragraphs, there are four instances where the word &quot;private&quot; must be changed to &quot;protected&quot;.

Change:

&quot;Finally, notice that the IComparable.CompareTo method isn't prefixed with a public or private access modifier. In fact, the C# compiler produces one of the following errors if a public or private access modifier is added:

error CS0106: The modifier 'public' is not valid for this item

error CS0106: The modifier 'private' is not valid for this item

The fact that IComparable.CompareTo can't have a public or private access modifier [...]&quot;

To:

&quot;Finally, notice that the IComparable.CompareTo method isn't prefixed with a public or protected access modifier. In fact, the C# compiler produces one of the following errors if a public or protected access modifier is added:

error CS0106: The modifier 'public' is not valid for this item

error CS0106: The modifier 'protected' is not valid for this item

The fact that IComparable.CompareTo can't have a public or protected access modifier [...]&quot;

Page 341: Error In Sample Code
There is an error in the code sample in the middle of page 341.

Change:

&quot;n = ((IComparable) v1).CompareTo(v2)); // Boxes v1 and v2&quot;

To:

&quot;n = ((IComparable) v1).CompareTo(v2); // Boxes v1 and v2&quot;

Page 346: Incorrect Capitalization In Code Sample
There is an error in the code sample in the middle of page 346. Uint32 should be UInt32.

Change:

&quot;public Uint32 PlatformId = 0;&quot;

To:

&quot;public UInt32 PlatformId = 0;&quot;

Page 348: Error In Text
There is an error in the text of the first paragraph on page 348.

Change:

&quot;System.Runtime.InteropService namespace&quot;

To:

&quot;System.Runtime.InteropServices namespace&quot;

Page 355: Remove &quot;and&quot;
On page 355, in the third paragraph, in the fifth sentence, change:

&quot;You'll recall that all CLS-compliant attributes are derived from System.Attribute and this type...&quot;

To:

&quot;You'll recall that all CLS-compliant attributes are derived from System.Attribute; this type...&quot;

Page 361: Error In Code Sample
There is an error in the code sample at the top of page 361.

Change:

&quot;// Override GetHashCode because Equals is overloaded.&quot;

To:

&quot;// Override GetHashCode because Equals is overridden.&quot;

Page 369: Error In Code Sample
There is an error in the code sample at the bottom of page 369.

Change:

&quot;void FeedbackToConsole(Object, Int32 , Int32 , String s) {&quot;

To:

&quot;Static void FeedbackToConsole(Object value, Int32 item, Int32 numItems, String s) {&quot;

Page 374: Correction To Code Listing
On page 374, in the first code listing (first line: &quot;public void ProcessItems(Feedback feedback) { &quot;), change:

&quot; feedback(items[item], item, items.length); &quot;

To:

&quot; feedback(items[item], item + 1, items.length); &quot;

Page 374: Correction To Code Sample
On page 374, in the code snip after the second paragraph, middle of the page, change:

&quot; feedback(items[item], item, items.length); &quot;

To:

&quot; feedback(items[item], item + 1, items.length); &quot;

Page 374: Correction To Code Sample
On page 374, in the second code snip after the second paragraph, middle of the page, change:

&quot; feedback.Invoke(items[item], item, items.length); &quot;

To:

&quot; feedback.Invoke(items[item], item + 1, items.length); &quot;

Page 378: Error In Code Sample
There is an error in the code sample in the middle of page 378.

Change:

&quot;Feedback fb3 = new Feedback(appobj.FeedbackToStream);&quot;

To:

&quot;Feedback fb3 = new Feedback(appobj.FeedbackToFile);&quot;

Page 378: Errors In Code Sample
There are two errors in the code sample at the bottom of page 378.

Change:

&quot;fbArray[2] = new Feedback(appobj.FeedbackToStream);

Feedback fbChain = Delegate.Combine(fbArray);&quot;

To:

&quot;fbArray[2] = new Feedback(appobj.FeedbackToFile);

Feedback fbChain = (Feedback) Delegate.Combine(fbArray);&quot;

Page 381: Missing Parenthesis In Code Sample
On page 381, in the Note box, in the code sample, a parenthesis is missing. Change:

// Do fb and fbChain refer to the same object? &quot;False&quot; Console.WriteLine(Object.ReferenceEquals(fb, fbChain); To: // Do fb and fbChain refer to the same object? &quot;False&quot; Console.WriteLine(Object.ReferenceEquals(fb, fbChain));

Page 383: FeedbackToStream Should Be FeedbackToFile
There are four instances of FeedbackToStream in the code sample on page 383. All of these instances of FeedbackToStream should be changed to FeedbackToFile.

Page 438: Error In Table 18-2
There is an incorrect statement in the Description column of the 2 row in Table 18-2.

Change:

&quot;In this case, no dialog box is displayed to the user and AppDomain's UnhandledException event doesn't fire. Instead, the CLR ...&quot;

To:

&quot;In this case, no dialog box is displayed to the user. Instead, the CLR ...&quot;

Page 459: Error In Code Sample
There are two error in the code sample at the top of page 459.

Change:

&quot;Console.WriteLine(a.Length);&quot;

// After a.Length returns, a isn't refered to in the code and is no&quot;

To:

&quot;Console.WriteLine(a.Count);&quot;

// After a.Count returns, a isn't refered to in the code and is no&quot;

Page 473: &quot;would&quot; Should Be &quot;should&quot;
On page 473, in the comments section of the code listing section beginning &quot;// The common method that does the actual cleanup. &quot;, change:

&quot;// If this class weren't sealed, this method would be protected.&quot;

To:

&quot;// If this class weren't sealed, this method should be protected.&quot;

Page 473: &quot;wouldn't&quot; Should Be &quot;would&quot;
In the code listing on page 473, line 31, change:

&quot;// If this class weren't sealed, this method wouldn't be protected.&quot;

To:

&quot;// If this class weren't sealed, this method would be protected.&quot;

Page 477: &quot;didn't&quot; Should Be &quot;did&quot;
On page 477, in the paragraph immediately after the code listing, third sentence, change:

&quot;For if Finalize didn't execute, [...]&quot;

To:

&quot;For if Finalize did execute, [...]&quot;

Page 491: Error In Code Sample
There is an error in the code sample in the middle of page 491.

Change:

&quot;// This static ArrayList contains references&quot;

To:

&quot;// This static Stack contains references&quot;

Page 492: Missing } Bracket In Code Sample
&quot;The second instance of the code sample located at the end of the Expensive destructor on page 492 is missing a } bracket.&quot;

Change:

pool.Push(this); } To:

pool.Push(this); } }

Pages 496 & 497: &quot;J&quot; Should Be &quot;K&quot;
In figures 19-12 and 19-13, on pages 496 and 497, the letter &quot;J&quot; found in the box should be changed to a &quot;K&quot;.

Page 500: Error In Code Sample
There is an error in the code sample at the bottom of page 500.

Change:

&quot;// Create a new BaseObj in the heap.&quot;

To:

&quot;// Create a new GenObj in the heap.&quot;

Page 523: Delete &quot;second version&quot;
On page 523, in the first sentence of the section &quot;Reflecting Over a Type's Members: Binding&quot;, change:

&quot;In the second version of the Reflector application, [...]&quot;

To:

&quot;In the Reflector application, [...]&quot;

Page 535: Incorrect Version Statement
There is an incorrect version statement in the middle of page 535.

Change:

&quot;Version=1.0.2411.0&quot;

To:

&quot;Version=1.0.3300.0&quot;

Page 537: RunTime Should Be RuntimeType
There is an error in the text at the top of page 537.

Change:

&quot;the IL code just saves the RuntimeTime reference...&quot;

To:

&quot;the IL code just saves the RuntimeType reference...&quot;

Page 539: Error In Table 20-3
There is an error in the Description column of the IsDefined row in Table 20-3.

Change:

&quot;Returns true if one and only one instance...&quot;

To:

&quot;Returns true if at least one instance...&quot;

Page 547: Incorrect Text In Important Box
There is an error in the last paragraph of the Important box on page 547.

Change:

&quot;invoke a member, the member performs the same kind&quot;

To:

&quot;invoke a member, the method performs the same kind&quot;

Page 553: Incorrect Statement
There is an incorrect statement in the first paragraph on page 553. The second half of the first paragraph after &quot;Note that these methods&quot; should be removed.

The remaining text should read:

&quot;All these methods return Type objects that represent an interface.

Determining which members of a type implement a particular interface ...&quot;

Page 553: Incorrect Text
There is an incorrect reference to Type in the last paragraph of page 553.

Change:

&quot;about the interface's member as defined by the Type.&quot;

To:

&quot;about the interface's member as defined by the TargetType.&quot;

Microsoft Press is committed to providing informative and accurate books. All comments and corrections listed above are ready for inclusion in future printings of this book. If you have a later printing of this book, it may already contain most or all of the above corrections.

Additional query words: 0-7356-1422-9 RICHTER

Keywords: kbdocerr kbdocfix kbinfo KB323147

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.