Mega Code Archive

 
Categories / Delphi / Examples
 

Move components from delphi 5 to delphi 6

Moving components from Delphi 5 to 6 can be a problem. How can we do it? Have you tried to compile your components, or 3rd party components you have in Delphi 5 into Delphi 6? 99% of them will not compile. However do not despare. It is only because of a few changes Borland has implemented on their latest product. This article covers the major changes. First of all, you will discover that the unit dsgnintf.pas is missing. Borland changed the name to Designintf.pas, moved the property editor code to a new unit, called DesignEditors.pas, put the constants used inside DesignConsts.pas and the menus inside DesignMenus.pas Also the variants have moved from system.pas to their own unit called Variants.pas The IFormDesigner interface isn't there anymore. You should use the IDesigner and typecast your variables. (this is a change probably made to accomodate the CLX and I was unable to find any documentation on it from either Borland or Delphi 6 Online help system. I only found that every IFormDesigner has been repaced with IDesigner) The IDesignerSelections interface has also changed. The most helpfull change is the addition of a Get function that returns a TPersistent when giving the index of the member. On previous versions if you wanted the TPersistent of an object you wrote: var p:TPersistant; ... P:=Selections[i] as TPersistant; Now you only write: var p:TPersistant; ... P:=Selections.get[i]; The IComponentDesigner interface is a new Interface located in ComponentDesigner.pas as part of the Designide.dcp package and is not a redistributable file. So you will have to include the DesignIde.dcp package in the Design time package for the compilation to work if this file is required. That's about it. I have used these simple instructions to recompile all of my third party tools, and all of my custom components. P.S. Just remember... you have to have the source code to do this!!! :-) P.S 2 Some more changes 1. IDesigner.root was a TForm before. Now it is a TComponent 2. Previously, Proxies.dcu was awailable as a stand alone file, now it is part of designIDE design time package. If you dont have seperate runtime and designtime packages for your component, you will need this package in the include list, however, you are not allowed to distribute designIDE.dcp 3. some of the constants are moved to VCLConsts unit.