[Lazarus] converted Delphi 7 project: add new form not possible?

Werner Pamler werner.pamler at freenet.de
Fri Feb 24 23:00:17 CET 2023

Am 24.02.2023 um 21:35 schrieb John Landmesser via lazarus:
> Hi,
> I tried to extend an existing and converted  Delphi 7 project by adding
> new form to the converted Delphi 7 project.
> But that leads to an AV-error if i try to show this new form by code!

I normally convert Delphi projects manually - it's more work, but I know 
what's happening then... And the manual conversion of your test project 
worked flawlessly.

But anyway: When trying to use the IDE's Delphi converter I saw two 

/1/ The newly added form is named Form1 (type TForm1) and this screws up 
the entire project since these identifiers already exist in the Delphi 
project. I can circumvent this issue when I close the IDE after 
conversion and create the new form only after a restart.

/2/ But this does not prevent the other issue: The IDE refuses to add 
the new form to the list of auto-created forms, and therefore a call of 
"Form2.Show" in the OnClick handler of your button on Form1 must fail. I 
have no idea what prevents the new form from being auto-created. As a 
work-around I added the line "Application.CreateForm(TForm2, Form2);" to 
the project unit manually (and Unit2 to its uses clause). - This way it 

Please file a bug report.

More information about the lazarus mailing list