简体   繁体   中英

Upgrade Delphi 2007 to XE6 - Where's the Type library Editor?

This is probably something stupid I am doing but I have upgraded from 2007 to XE6/7 and I can't seem to find the Type library editor in the new version.

I understand the TLB formats have changed in later versions, I have Myproject_TLB.pas style files which compile OK but I can't change them.

The help file seems to suggest the Library editor is still there but I can't find a way to get to it, the "View/TYpe Library" option is greyed out.

Can someone point me in the right direction, I need to add some more properties and the help files are not useful.

The Type Library Editor is still present but is now an embedded editor for the RIDL file type. As per David's comment, the IDE now uses this RIDL file format as the storage format for type libraries, rather than the TLB file.

When you open a RIDL file in the XE6+ IDE, you will find a very familiar editor interface - basically the Type Library Editor . However, instead of the old Text tab alongside Attributes , Uses , Flags etc etc along the top, it is now reached via the bottom tab strip. The RIDL (Text) view is presented in the Code tab whilst the Type Library Editor style view is presented by the Design tab.

All you need to do is convert your TLB files in your D2007 project to the RIDL format and add these RIDL files to your XE6+ projects. The TLB files will be produced from these RIDL files as needed by the IDE similar to the way that binary RES files are produced from RC resource scripts.

The old Type Library Editor also supported this RIDL format, so one way to get your old TLB files into RIDL might be:

  • Open the TLB file in the D2007 IDE Type Library Editor
  • Select the library root node in the hierarchy
  • Switch to the Text tab
  • Select the entire contents
  • Copy/Paste into a text editor and save as a file with a RIDL extension
  • Add that RIDL file to your XE6+ project

You can then choose to modify your Type Library either by directly editing the RIDL or using the Design interface, which will perhaps be more familiar to you. Whichever option you choose however, it is now the RIDL file which should be added to your version control, not the TLB.

If you do not have an older IDE available, or if you simply prefer, you can use a command line utility provided with Delphi to do the conversion:

tlibimp -I foo.tlb

Will create the foo.ridl file for the specified foo.tlb input file. Note that this form of the -I option is not supported on older versions of tlibimp but should be supported by the version provided with Delphi 2010 and later.

If you get an error saying that you need a "+" or "-" tagged on after the "I" option, then you are running an older version of tlibimp , perhaps being found on your path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM