By: Kris Houser
Abstract: This help topic describes all the new features of Delphi 2009 and C++Builder 2009.
This release provides key new features for developing applications using both Delphi and C++Builder.
CDN NOTE: The original help topic contains many links to help topics. The links have been removed from this CDN version of the online help topic. If you want to see the help hyperlinks, go to the product's online help and locate the topic (in the Index, look for What's New; in the Contents, go to Common/Concepts/GettingStarted, and select the What's New topic).
Please note that this release is a breaking change in both Delphi and C++Builder. The main focus and feature of this release is the change from using ANSI-based strings to using a Unicode-based string type, appropriately named UnicodeString. This means that to use Delphi or C++Builder 2009 to work on pre-existing applications, you need to make some modifications in your code, largely related to string handling, and you need to successfully recompile your code.
Incorporating Unicode into client-server or multi-tiered applications and websites offers significant cost savings compared to legacy character sets. Unicode enables a single software product or a single website to be targeted across multiple platforms, languages and countries without re-engineering. It allows data to be transported through different systems without corruption.
The IDE is fully Unicode-enabled, from top to bottom, left to right, and front to back. The entire IDE itself is now a Unicode-based application, requiring that all components and design-time code be based on the UnicodeString type as well. Unicode characters are fully supported in identifiers and strings. See "Unicode in the IDE" for more details.
There are some exceptions: You cannot use Unicode characters in DLL names. A few command line utilities such as MAKE, IMPDEF and IMPLIB cannot handle Unicode file names.
The change in the default string type affects other data types and many functions as well. For example, SizeOf(Char) is now 2 bytes, not 1 byte. Calls to Length(MyString) return the number of characters, not the number of bytes in the string.
You can also use Unicode in the command console by setting the font and code page properties. See the help topic "Unicode in the command console."
First and most important, to use Delphi or C++Builder 2009, you need to make some changes in your existing code and then recompile your application to handle Unicode, as described in the help topic "Enabling Your Applications for Unicode."
Backing Up Your Projects: You cannot migrate a project from the 2009 version to any earlier version. Before you open your existing projects in Delphi or C++Builder 2009, you might want to make a backup copy of the project so that you can restore the project in its entirety if unexpected problems occur.
Format of Project File Has Changed: For both Delphi and C++Builder, the format of the project file has changed in order to accommodate new features of this release. Project files have a file extension of .dproj, .cbproj, or .bdsproj. When you open any previously existing Delphi or C++ project, the compiler first saves a backup copy of your project file with the extension .2007.
The following message is displayed for a Delphi project (a similar message appears for a C++ project):
Project <project_name> is about to be upgraded. The project will no longer be usable with previous versions of the product. A backup of the project will be created.
Backup project name: <editable_field>
A checkbox allows you to prevent the message from recurring and to always create backup files. The project file is opened and saved in MSBuild format, and then reopened in the IDE. Note that the compilers in Delphi and C++Builder 2009 are version 12.
The following changes have been made in the Delphi compiler:
The following changes have been made in the Integrated Development Environment:
The following key features are new or significantly changed:
For example, to use the Boost minmax library, your code should specify:
To view the help for the Boost libraries, go to http://www.boost.org/doc/libs/1_35_0/libs/libraries.htm.
C++Builder previously included code visualization in a one-way UML Class diagram viewer. C++Builder now has live code and two-way UML modeling in the Class diagram. This means you can work in the source code, work in the UML model, and move back and forth with full, live synchronization - "the code is the model, the model is the code."
C++Builder includes support for the Class, Use Case, Sequence, Collaboration, Component, Deployment, Statechart, and Activity diagrams.
The C++Builder modeling support also includes design pattern support including "create by pattern" and harvesting objects in your models with the "save as pattern." C++Builder supports Gang of Four design patterns including the Behavioral, Creational, and Structural groups of patterns.
The COM wizards have been revamped and enhanced for Delphi and C++Builder 2009, and one new COM wizard has been added (ActiveX Control). The wizards are available in the ActiveX and Multitier folders in the New Items dialog box. The COM wizards are: COM Object, Automation Object, Active Form, Active Server Object, Remote Data Module, Com + Event, COM + Subscription, Property Page, ActiveX Control, Transactional Object, Transactional Object, Transactional Data Module, Type Library, ActiveX Library. Both the ActiveX Library wizard and the Type Library wizard are project level wizards, and thus they are only available from the gallery if there is no active project. All other COM wizards are only available if there is a valid project open to contain them. See the help topic "Using COM Wizards."
A new file type has been added to the COM architecture – the text-based RIDL file (Restricted Interface Definition Language). The RIDL file is the storage mechanism that the project uses to persist the type library data to disk. The binary .tlb file is now an intermediate file (like a .res, .dcu, .obj, and so forth). This means that you can rebuild the .tlb file from the command line (outside the IDE), that you can edit .tlb files using a text editor, and the history is stored by the IDE. See the help topic "Saving and Registering Type Libraries."
The Type Library Editor now works on top of a .text file (the .RIDL file) instead of the binary .tlb. The .text file is compiled using the new type library generator, GenTLB.exe, to generate the binary .TLB file. This change means that:
The Type Library Editor window now has three new tabs located on the lower edge of the window:
Refresh works differently for the Type Library Editor now. You can click the Refresh button on the Design page to have your Delphi or C++ sources updated after you change your type library. The IDE will also 'Auto-Refresh' on the following events:
Use the Type Library Explorer for read-only viewing of binary-format .tlb files. Choose File > Open and select a .tlb file.
Many changes have been made to improve support for database application development.
Unicode support has been added to the Oracle, Interbase, and MySQL dbExpress drivers.
The dbExpress driver framework has these changes:
DataSnap is a multi-tier architecture for database applications. DataSnap provides a middle-tier application server that contains and manages remote data modules. DataSnap has been enhanced to provide a very general connection mechanism between components in different tiers.
The new class TDSServer manages the creation and lifetime of transports and server method classes. You can use TDSServer to create your own middle tier server. The new component TDSServerClass can be used to specify an application server-side class with published methods that can be called from a remote client using dynamic method invocation. Methods in this class can be called from remote clients, such as the DBX Client Provider or the ADO.NET provider.
Once you have connected to a DataSnap server, you can call methods in an application server similarly to stored procedures. For instance, you can use the new class TSqlServerMethod to call server methods by specifying a text class and method name for command text and parameters for the method. Server methods can use a TDBXReader to receive and return datasets to and from the client.
The new smart tables are an abstraction of the different datasets Datasnap supports, so they can be passed transparently between client and server.
You can still write application server side classes that extend TRemoteDataModule, so that the providers they contain can be accessed by the new client-side TDSProviderConnection client component. TDSProviderConnection provides connectivity to a DataSnap server using dbExpress and is provided to keep existing applications compatible and take advantage of new DataSnap features. New applications do not need to use TRemoteDataModule or TDSProviderConnection with DataSnap.
Application servers need not be connected to databases at all. A server methods class has only two requirements:
For more information about DataSnap, see http://blogs.codegear.com/steveshaughnessy/2008/07/20/38912.
Getting BlackfishSQL Licenses: The way you get deployment licenses for Blackfish SQL has changed. You no longer use the .slip file that was previously included with the product. Now you can generate a deployment license file online at http://reg.codegear.com. For more information about installation, deployment, and licensing, see the Install, Deploy, and License files located, by default, at C:\Program Files\CodeGear\RAD Studio\6.0.
Protected API Now in the Help: Protected methods (procedures and functions) and protected properties are now included among the API help topics.
See a Preview of VCL Components in CDN: For an illustrated summary of new and enhanced components for this release, see this article by Anders Ohlsson:http://dn.codegear.com/article/38349.
See Some of the New VCL/RTL Features to Support Unicode: This CDN article is Part II of Nick Hodges' series about Delphi in a Unicode World. He describes highlights of API for Unicode, such as Character and TEncoding: http://dn.codegear.com/article/38498.
Microsoft Windows Compatibility: Some components, classes, methods, and properties are compatible with the look and feel of the Windows Vista operating system. For a list of controls that are available on Vista, see the help topic "Components Available Only on Specific OS."
VCLJPG to VCLIMG: The vcljpg package was removed and its contents are now in vclimg. Update projects using vcljpg to use the vclimg package instead.
TDataSet Changes in Bookmark Handling: DB.TDataSet has some significant changes in its handling of Bookmarks:
Bookmark := MyDataSet.GetBookmark;
For handling strings in the new Unicode mode, you might need to use the SysUtils.TEncoding class as described in the help topic "Using TEncoding for Unicode Files."
The following classes have enhancements:
One of the new features is support for the 2007 Microsoft(®) Office Fluent(TM) User Interface. This is commonly known as the ribbon. The ribbon is managed by TActionManager. TActionManager allows you to develop more usable applications by deploying the IDE to create ribbons for your Delphi application. Using TActionManager enables you to create commands, buttons, and graphics linked to these ribbons.
Support for ribbon controls includes the following core components:
To create an application using ribbons, you start by creating a new Delphi Win32 VCL application. For applications that already use TActionManager, you can simply change the Style to be one of the three included ribbon styles or convert your existing user interface to use the ribbon.
Ribbon Controls Demos: Three demos for ribbon controls are installed with the product. Go to My Documents | RAD Studio | 6.0 | Demos | DelphiWin32 | VCLWin32 | RibbonControls.
Related topics about ribbon controls:
ITE and ETM are now available for both Delphi and C++Builder.
The Integrated Translation Environment (ITE) is a part of the IDE that simplifies localizing your projects. ITE can create a new localized project from an existing project. ITE does not automatically translate text, but provides a dialog listing all text that needs to be localized and fields in which to enter the corresponding translated text. Once you have entered the translated text and built the localized project, you can set another language active and display a form in the localized text; you don't have to switch locales and reboot your system. This allows you to perform localization without requiring a localized system.
The External Translation Manager (ETM) is a standalone application that works with DFM files and text strings in the source code. Although ETM does not allow you to create a new localized project, it does provide a dialog listing localized text and the translated text, similarly to ITE.
Command Help: Help is now available for the commands on the various drop-down menus in the IDE, such as the File menu and Component menu.
Optimizing Your Access to the Online Help: Do you sometimes have frustrating problems when you try to use the online help? See the following article in CodeGear Developer Network for valuable tips about using and customizing the help viewer, setting the filters and other options to control the Index and Search capabilities: Getting the Best Results with RAD Studio Online Help.
The F1 context-sensitive help dialog now displays RAD Studio results at the top of the list.
Could not retrieve comments. Please try again later.
Download Delphi 10 now!
Webinars on demand!
More social media choices:
Delphi on Google+
@RADTools on Twitter
Server Response from: ETNASC03