Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi and COM: TLB and maintenance issues

In the company that i work, we develop all the GUI in C#, but the application kernel is mainly developed in Delphi 5 (for historical reasons), with a lot of components made in COM+. Related to this very specific sort of application a I two questions:

  • Experienced guys in Delphi and/or COM, do you have any workrounds to work with the buggy TLB interface ? Some of the bugs are: IDE crashing during edition of a large TLB, lost of methods IDs, TLB corruption, etc. Here, we haven't found any good solution. Actually we tried do upgrade do the new 2007 version. But the new IDE TLB interface has the same bugs that we found before.

  • How do you control TLBs versions ? The TLB file is in a binary format and conflict resolutions are very hard to do. We tried to do it exporting the interfaces descriptions to IDL and commiting into CVS, but we didn't found any good way to generate TLBs from IDL using Delphi. Additionaly, the MIDL tool provided by Microsoft, didn't parse correctly the IDL files that we exported from delphi.

like image 945
Gustavo Avatar asked Aug 19 '08 20:08

Gustavo


2 Answers

I think you should have a good look at Delphi 2009.

Delphi 2009 has changes to the COM support, including a text-based replacement for the binary TLB files.

You can read more on Chris Bensen's blog.

like image 192
Roddy Avatar answered Nov 06 '22 12:11

Roddy


In the distant past (before I started working for CodeGear) I gave up on the odd Delphi-ized IDL language that the IDE presented, and wrote my own IDL and compiled it using MS midl. This largely worked; the only catch, IIRC, was making sure dispids (id attribute) were correct on automation interfaces (dispinterfaces) for property getters & setters - there was some invariant that tlibimp expected but midl didn't guarantee.

However, now that Delphi 2009 uses a safe subset of midl syntax, and includes a compiler for this midl in the box and integrated into the IDE, these problems should be a thing of the past.

like image 35
Barry Kelly Avatar answered Nov 06 '22 13:11

Barry Kelly