We help IT Professionals succeed at work.

shifting delphi 4 prog to delphi 5

third asked
Medium Priority
Last Modified: 2010-04-06

i have a program created in delphi 4 which also includes custom components. im not so sure of the clear steps on how to migrate it to delphi5 but here is what ive done.
1. installed the package including all necessary components to delphi5
2. opened the project and tried to recompile.

during compilation an error stating like,
"Unit StdCtrls was compiled with a different version of Forms.TCustomForm"

so what i did was i copied the stdctrls.pas of delphi 4 saved it as stdctrls2.pas then recompiled.

another error come out which states,
"Incompatible types: 'TControl' and 'TCustomComboBox'"
"Incompatible types: 'TWinControl' and 'TCustomComboBox'"
"Incompatible types: 'TControl' and 'TButton'"

this error comes out in the source file i renamed. ie stdctrls2.pas. i just wonder why an error comes out where i just changed the name of the unit. i know im just missing something here i cannot i figure out. can u help me on this.



Watch Question

The bottom line is that you have to have the PAS files for the custom components to be able to use them in Delphi 5. The DCU file formt is different in every version of Delphi (and always has been), so that when you port from one version to the next, you either have to upgrade the DCU's from the manafactuer, or have the original source PAS. You can klunk around with all the varoius files, but in the end, you'll still need to be able to recompile the compenents or obtain them already compiled.

Good luck!!



so you mean i need to recompile all the pas files from my custom components. i have the source files in hand. how can i recompile the custom components package? do i need to install each component one by one? can't it be done by using the previous package? can you give me some clear steps on this.


The easiest way by far if you have the source files is to go ahead and create a brand new Delphi 5 package. This way you are assured that the DCR files that store the icons for tool pallette are compatible, paths are correct, etc.

Good luck!!


i have created a new delphi5 package, installed it and it worked good so far. but again when i tried the program the first error still comes out.

"Unit StdCtrls was compiled with a different version of Forms.TCustomForm"

the error is pointing StdActns in the implementation section of the unit named "Forms". i.e.


uses ActiveX, Math, Printers, Consts, CommCtrl, FlatSB, StdActns;  "

when i open this unit it uses this Stdctrls unit. i.e.


uses Classes, ActnList, StdCtrls, Forms;  "

how can i fix this error. tnx...


i found my own problem. i have an old version of forms.pas located in the path of the installed components. i just removed the file then that error is gone. ill give updates tomorrow...

Explore More ContentExplore courses, solutions, and other research materials related to this topic.