How to autogenerate *_TLB.pas in Delphi XE?
Asked Answered
N

1

9

We have been updated our project to Delphi XE. There's .ridl files instead .tlb. But what's about *_TLB.pas files? How to migrate changes in .ridl file to *_TLB.pas file?

Delphi XE doesn't modify this file at all.

Neck answered 6/9, 2011 at 14:12 Comment(0)
M
17

Open the type library editor and press the refresh implementation button.

See the help for more information.

Update :

Make sure the .ridl file is in the project manager.

From the IDE : View|Type library should now be enabled.

Open the type library editor from here.

The _tlb.pas file should not be opened in any editor window.

Pressing the refresh implementation should update the _tlb.pas file.

(Sometimes the save .ridl button is needed first)

At occations I have to save the project, close and restart the IDE before correct information is there.

Sometimes you must unregister the library before doing all this.

Moorman answered 6/9, 2011 at 14:57 Comment(5)
Thanks, LU RD! Delphi XE doesn't refresh implementation on save in text mode of .ridl file. Also it doesn't refresh implementation on save in GUI mode of .ridl file in my case (only generates .ridl file).Neck
Yes, it can be frustrating at times working with the type library editor. See my updated answer for some hints.Moorman
I've had to crate an empty "xxx_TLB.pas" file - then it workedMelville
Thank. I was missing the "Make sure the .ridl file is in the project manager." step. Project had been ported from D2007, which (sort of) "worked" on the tlb file.Prate
Same issue still exists in Rio 10.3 (still have to create an empty TLB.pas to make it work).Hilary

© 2022 - 2024 — McMap. All rights reserved.