Migrate an old Kylix project to Delphi 2007

I got a question today how to migrate an old Kylix project to Delphi 2007 and here is what I answered. None of our current products support the CLX-framework any more for legal reasons (CodeGear does not have a license from Trolltech on Qt library). It is possible to manually convert a Kylix project to an ordinary Delphi project very easily, though. Here is a simplified description of the approach:

  • You need to rename the units in the uses clause in all pas-files. Usually you only need to remove the Q infront of the unit name.
  • For forms you need to change the extension of the xfm file to dfm. Change the $R directive in the pas-file to include the dfm file instead.
  • Properties should be 99% compatible with current version. Open each converted form in Delphi to verify this. If there is any problem, click ignore and make a note so you can investigate if it demands any adjustments.

If you have more tips and trix, drop a comment in my new blog at blog.fredrikhaglund.se

Posted by Fredrik Haglund archive on September 6th, 2007 under Delphi | Comment now »


Vista Enable Your Applications

(Moved to new blog…)

Posted by Fredrik Haglund archive on July 18th, 2007 under Delphi | 2 Comments »


UAC and Signed Applications

(Moved to new blog…)

Posted by Fredrik Haglund archive on June 8th, 2007 under Delphi | 1 Comment »


More about BDE

(Moved to new blog…)

Posted by Fredrik Haglund archive on May 12th, 2007 under Delphi | Comment now »


Small questions

(Moved to new blog…)

Posted by Fredrik Haglund archive on May 9th, 2007 under Delphi | 2 Comments »


Vista User Account Control and Command Line Applications

(Moved to new blog…)

Posted by Fredrik Haglund archive on March 19th, 2007 under Delphi | 7 Comments »


Friday

I have been teaching Delphi in Linkoping, Sweden this week. Even if you know your topic it requires constant concentration and it is exhausting but fun.

This week, a colleague of mine attended the Java User Group meetings in Stockholm and Gothenburg (together with 350 Java developers) and talked about JBuilder 2007. Most seem to have the understanding that we have been knocked-out but are happy to see us up and running again with new innovations in the Java area and a good well founded support for our Eclipse strategy. All developers that we have spoken to are courious about JB2007 and most understand the needs we address in the product and they way we are doing it. All find Eclipse to be a hassle to configure but really appreciate the open api’s and flexibility, from that perspective all buy into what we are doing with JBuilder.

It is nice to have a company name again and at December 13th we (the eight CodeGear guys in Stockholm) move to our new office in Solna Business Park.

There are a lot of Delphi activities in Scandinavia the following weeks.

Delphi Migration Seminar and Workshop

For Delphi developers that want help to upgrade their projects from Delphi 5, 6, 7 to Delphi 2006 or want to learn more about what they have to do to adapt their applications to Windows Vista.

Copenhagen, December 7th

Gothenburg, December 8th

Helsinki, December 11th

Stockholm, December 12th

Delphi Day in Oslo

There are also plans for a one day seminar in Oslo at December 15th. More details are coming about this…

Have a look at Jedi Code Format

A very useful little tool if you are running into a project that has all text in uppercase and no indenting. I love it! I just had to tell you about it if you missed it.

Posted by Fredrik Haglund archive on November 24th, 2006 under Delphi, Personal | Comment now »


Looking for a new Job?

I noticed that Skype is searching for a new Delphi programmer doing UI Development for Windows. Interesting if you happens to live in Estonia!

You do not have so many options good options today if you want to develop native applications (and with native I mean not a managed .NET application). I guess the main candidates are Delphi, C++Builder, VB6 and possible C++ if you like MFC. Correct me if I’m wrong…

Posted by Fredrik Haglund archive on September 23rd, 2006 under Delphi | 6 Comments »


User group meeting in Stockholm

Yesterday evening I attended a Delphi user group meeting in Stockholm, Sweden.

 

Memory Manager

I spoke very shortly about the change of Memory Manager in Delphi 2006. Except for the IDE, the new memory manager only affects Delphi and C++ applications compiled to native code (i.e. Win 32) not .Net applications.

 

function GetMem(Size: Integer): Pointer;

function FreeMem(P: Pointer): Integer;

function ReallocMem(P: Pointer; Size: Integer): Pointer;

 

The Memory Management is only three functions to implement as effectively as possible. These basal functions are used by almost everything in you application so changing them can have a remarkable effect on your application - they affect the overall speed and memory usage.

 

But implementing them is easier said than done. There is a lot of interesting optimizations problems; memory fragmentation is one area.

 

Memory Fragmentation

The large rectangle in picture 1 represents one part of your heap. It is a larger memory block that the memory manager required from the operating system. The green rectangles are smaller blocks that are in use – they could contain for example a string, a button instance, a dynamic array, etc.

 

In picture 2 more objects are created and space is reserved for them on the heap. In picture 3 old objects are freed and memory is available for use again. Notice that we get gaps. In picture 4 we need to allocate room for a new block that is slightly larger. We need to spend time to search for a space that is large enough and when we find a gap the fit might not be perfect and we get smaller gaps of unused space.

 

 

FastCode Project

In 2005 the FastCode Project had a challenge to write the fastest replacement for the Delphi Memory Manager. The Fastcode Challenges is a project running on a volunteer basis that provides highly optimized functions for the Delphi community. (Thank you guys!) Functions are faster versions of Delphi runtime library functions, VCL functions or functions meant as extensions for these.

 

Pierre le Riche won the challenge with his memory manager FastMM. In Developer Studio 2006 (and the new Turbo Delphi and Turbo C++) is the old Memory Manager (located in getmem.inc) replaced with Pierre’s code from FastMM.

 

New and Old

The FastCode project has a benchmark and validation tool to measure and test the different contributions and the benchmark below compares the default memory manager in Delphi 7 and Delphi 2006

 

 

As you can see there is a drastic difference. Will it double the speed of your application if you recompile? Probably not but it depends on your code off course. I guess the easiest way to find out is to recompile your application in Delphi 2006 and test.

 

There are other benefits except for increased speed and reduced memory consumption. Since there is less memory fragmentation, memory intense application can run longer before the dreaded out of memory exception occurs. You can also use more than 3GB memory.

 

Report on Memory Leaks

The new memory manager works differently than the old memory manager and does more pointer checking, so it will catch more errors.

 

Setting ReportMemoryLeaksOnShutdown to True shows a message box with a report on all memory leaks every time you shut down your application.

 

{Display leaks on shutdown if a debugger is present}
ReportMemoryLeaksOnShutdown := DebugHook <> 0;

 

Turning it on can be a bit horrifying if you add it to an existing project. It will take some time before you get a clean project but it can be very useful if you have it in place from the beginning of a new project.

 

Read more about the new memory manager in a BDN article by Pierre le Riche.

 

Stuck on older versions?

It is possible to replace the default memory manager in older Delphi versions with your own. The only thing you have to do is to call SetMemoryManager in the System unit. If you have an old Delphi application you have not upgraded yet it is possible to download FastMM and use it in your existing application.

 

 

Posted by Fredrik Haglund archive on September 15th, 2006 under Delphi | Comment now »


Front, Middle or Back?

I attended the annual autumn seminar organised by the Delphi user group in Gothenburg, Sweden. We where twenty four enthusiastic Delphi hackers networking and sharing ideas about development. I was invited to talk about the Roadmap of DevCo’s products and listen to feedback.

We ended the day by visiting the amusement park Liseberg. They have a cool rollercoaster built in wood called Balder and I tried to empirical find out where it is best to sit. “Different forces operate on the front and the back of the train and the ride in the front is distinctly different from the back. … The train is slowing down as the train begins to climb over the top of the hill, and speeding up again as it starts to descend again. Thus, if there is any airtime to be had before the top of the hill, it will be best in the front, as that is the part of the train moving fastest there, but airtime after the top of a hill will be best in the back. Thus, depending on the configuration of hills on a coaster, it may a better front seat ride or back seat ride.” For this rollercoaster I think the front seat is best. :-)

Hallvard Vassbotn, one of the Delphi Gurus in Norway, is bloging about community meetings in Oslo. He is also writing a lot of intresting things about what’s new in the language since Delphi 7.

One of the messages I bring back from the users at the Gothenburg meeting to DevCo is not to loose focus on native development. Win32 development is still very important. – Make it future proof with Win64 compiler, Unicode support and Avalon (WPF) for VCL and bring back Delphi.NET language improvements to the native compiler.

Next community meeting in the Nordic region is in Stockholm in 10 days: http://delphi.meetup.com/172/events/5040855/

Posted by Fredrik Haglund archive on September 4th, 2006 under Delphi | Comment now »



Server Response from: dnrh2.codegear.com

 
© Copyright 2008 Embarcadero Technologies, Inc. All Rights Reserved. Contact Us  |   Site Map  |   Legal Notices  |   Privacy Policy  |   Report Software Piracy