marco
cantu

Delphi Developer's Handook Delphi Developer's Handbook
Corrections and Updates

This page contains a few updates to the Delphi Developer's Handbook. As you can guess this is a work in progress. The first part of this paper covers few minor corrections, the second part will provide in future actual updates and new material (including suggestions from readers).


I. Corrections

Chapter 8 - Page 350 (TDdhFormExt component)

The code of the Create constructor uses the Owner property instead of the AOwner parameter in the initial test. Instead of
if (Owner = nil) and ...
the code should read
if (AOwner = nil) and ...

In the same example, the destructor causes a GPFault, because it uses the FormHandle method after the Owner paramater was set to nil by the VCL. The solution is to add a new private field:

private:
  // form handle
  fFormHandle: THandle;
initialize it in the constructror by writing:
  // grab the form handle
  fFormHandle := (AOwner as TForm).Handle;
before the form subclassing code. Finally update the FormHandle method as follows:
function TDdhFormExt.FormHandle: THandle;
begin
  Result := fFormHandle;
end;


Chapter 9 - Page 413

The two small listings in the first half of the page are inverted. The first should be procedure BtnCreateOwner and the second should be procedure BtnCreateNil.


Chapter 11: SimpleW2 Example

The are a couple of const parameters to remove to be able to recompile the source code.


Chapter 17 - Page 900 (GridDemo example)

The table component of the example refers to the BCDEMOS alias installed by Borland C++Builder instead of the DBDEMOS alias installed by Delphi (and used in many other examples).


Chapter 19 - Page 1003

The last paragraph indicates that the default value for the PacketRecords property is 5, but in fact it is -1. The text should read: ... PacketRecords property. If you enter a value, say 5, the provider will put five records in a packet. Alternatively, you can set this value to zero to request only for the field descriptors, and no actual data. At the other end of the spectrum, using -1 (which is the default value) transfers all records at once.


II. New Material

Chapter 15 - Page 786

Gerald Nunn has suggested me that a DLL expert can access Delphi internals in Delphi 3 just like a package based one can. As long as you compile your DLL expert to use VCL30.DPL, your DLL expert will be able to traverse the Application Components array and make changes to internal Delphi objects just like a package based expert can.


Chapter 20: Additional examples: ImageToJpeg, ChartToJpeg.

These examples have been added to Mastering Delphi 4.