This is a list of corrections for the book that have been found by readers. If you notice any other error or omission, please let me know. Beside this document, there is nother one with many updates related with new features of Delphi 2006. See my web site (www.marcocantu.com/md2005) for details.
The book fails to mention that there is a free utility called Delphi Configuration Manager and available at http://www.alphalink.com.au/~jed/dcm.htm that helps removing unneeded features form the IDE.
The SealedAndFinal example mentioned in the section “Sealed Classes and Final methods” is in fact part of the code for Chapter 4 and is available only in the Delphi for .NET version. Generating the Win32 version should be rather simple.
In the second paragraph, at the start of the 4th line, the word 'experiment' should rally be 'experience'.
Last paragraph, 'The parameter if this method...' should rather be 'The parameter of this method...'
At the end of the MiniSize program, the line:
MessageBox (0, PChar(strSize), 'Mini Program', MB_OK);
won't compile under .NET, where the PChar typecast has to be removed:
MessageBox (0, strSize, 'Mini Program', MB_OK);
The companion code is correct, the snippet in the book is not precise.
The .NET version of the RefList2 example doens't work. The ListView1Compare method needs a different signature, like the RefList example has. This is the correct code:
{$IFDEF CLR}
procedure ListView1Compare(Sender: TObject; Item1, Item2: TListItem;
Data: TTag; var Compare: Integer);
{$ELSE}
procedure ListView1Compare(Sender: TObject; Item1, Item2: TListItem;
Data: Integer; var Compare: Integer);
{$ENDIF}
The project source of the .NET example CommDlgTestNet is lacking the [STAThread] statement before its begin.
Again, the project source of the .NET example MouseActivateDemoNet is lacking the [STAThread] statement before its begin.
The third code snippet is incorrect. The line
for field in cds do
should have been
for Field in cds.Fields do
Recently, Google changed the HTML returned by searches, properly including quotes around the href attributes. This breaks the WebFind example. Here is the updated code (3 lines) in the procedure TFindWebThread.HtmlToList:
repeat
// find the initial part HTTP reference
nBegin := PosEx ('href="http', strRead, nBegin); //updated
if nBegin <> 0 then
begin
// find the end of the HTTP reference
nBegin := nBegin + 6; /////// updated
nEnd := PosEx ('>', strRead, nBegin);
strAddr := Copy (strRead, nBegin, nEnd - nBegin - 1); //updated
The book shows some of the problems of using the Firefox browser with ASP.NET sites. However, the book fails to mention that you can configure an ASP.NET server to better recognize the Firefox browser, by adding a special “browserCaps" subsection in the <system.web> section of the web.config file (or in the global machine.config file). Examples (and more details) are given at these pages: