We have been through two migrations (to Delphi XE2) in last few months so why not share our experience of XE2 migration with you all.

EMBT_Banner_Delphi_970x279

Some of the features that attracts you towards XE2:

1)  Unicode Support: Delphi XE2 has Unicode support. Unicode support for Delphi applications helps the applications to support characters from different languages including Chinese.

2)  Rich Interface for Applications:  Different styles can be applied to the UI components to get new look. FireMonkey helps to create 3D and highly interactive applications.

3)  Application level Validation made easy: Some of the components have extra properties for the validation purpose, which will help us to reduce the code and the application will be faster.

4)  Cloud Support: Easily setting up cloud database, so that the database  can be kept in the cloud and could be accessed by different devices.

Follow for more XE2 features.

Well before we start with the migrations we need to make sure few things:

1) List all the components that have been used in Application.

2)Check if any changes have been made to any of the Delphi or any third party component that you are using.

3)Check if all of the third party components that have been used in your application have support for Delphi XE2.

First thing that you need to do before migrating is to check all the components that are required and install them. This becomes one of the tedious tasks(especially if you are using trial version components) when you notice that some of the components you use in your project do not support XE2, in that case there are just two options left:

1) Inquire component vendor regarding the XE2 support and hope that they would (If you are using a trial version).

2) Search for an alternate component to do the same task, downside of this is you will have to make changes to your existing application code too.

If you already have the whole source code of your third party component then what some people do is they try to migrate that to the newer environment.

Now if there were any changes that were made to your third party components and you have installed newer version of third party component then you will have to reintroduce the changes made in previous third party source file in the newer version. While making the changes in the newer source file its better to compare the changed source files of the previous version with original source files on previous version and then introduce the same changes.

While compiling your old code most common error encountered is    ‘Datatype InCompatibility’.

1)  String is now UnicodeString  (Till Delphi 2009 it was Ansistring)

      UnicodeString  features :

  •       Strings as large as available memory.
  •       Efficient use of memory through shared references.
  •       Routines and operators that evaluate strings based on the current locale.

Follow UnicodeString.

2)  Char is now Widechar (Till Delphi 2009 it was Ansichar)

AnsiChar – with an 8-bit representation (accounting for 256 different symbols).
WideChar – with a 16-bit representation (accounting for 64K different symbols).

Same way  PChar pointer is now an alias of  PwideChar, rather than PAnsiChar as it used to be.

On the other side we can see that EXE size increase as compare to other versions , reason can be change to unicode strings, which by themselves double the size of every string in the project.

So that all from our side regarding Migrating your existing code to Delphi XE2 hope it helps you all and “All the Best” to those who are looking to migrate their existing Delphi code to Delphi XE2.