marco
cantu

Books : Mastering Borland Delphi 2005: Update for Delphi 2006

Mastering Delphi Update for Delphi 2006


Chapter 9

The RTL in Delphi 2006 for .NET

There are no differences in the FCL (Framework Class Library) between Delphi 2005 and Delphi 2006, both being based on version 1.1. of the .NET framework. There are some changes in the Windows native runtime library. Some of the new features relate to general RTL improvements discussed in the ebook additions for Chapter 4. (Note: the new memory manager and the optimized assembly code implementations are not used in .NET).

RTL's CF Support

The most notable update specific to Delphi for .NET is the support for the .NET Compact Framework that Borland has added to the Delphi for .NET RTL. Some of the features of RTL for .NET have been modified to accommodate the lack of some capabilities of the smaller CF library. In other cases there are alternative implementations.

For examples, the TObject class helper re-introduces a method of the System.Object class that the CF doesn't support:

type

  TObjectHelper = class helper for TObject

  public

{$IFDEF CF}

    class function Equals(AObj1, AObj2:

      System.Object): Boolean; overload; static;

{$ENDIF}

Remember that CF is a not a compiler-based define, as explained in the update material for Chapter 4. There are also specific class helpers that reintroduce missing features in classes like System.Array, System.BitConverter, System.Activator, and System.DateTime. The CF RTL provides also partial console support.

Other RTL features are disabled because the CF platform doesn't support them at all, such as threading. The use of threadvar in the RTL is not activated for CF applications. The CF support starts with the system unit (Borland.Delphi.System) and reaches up to Borland.Vcl.Classes, also including units like Borland.Vcl.IniFiles, Borland.Vcl.SysUtils, and Borland.Vcl.TypInfo. The complete list of these units can be found under the folder ($BDS)\lib\cf, that is by default C:\Program Files\Borland\BDS\4.0\lib\cf.