<p>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:</p>

<ul>
<li><p>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.</p></li>
<li><p>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.</p></li>
</ul>

[{'answer_id': 17642, 'author': 'Roddy', 'author_id': 1737, 'author_profile': 'https://Stackoverflow.com/users/1737', 'pm_score': 4, 'selected': True, 'text': '<p>I think you should have a good look at Delphi 2009.</p>\n\n<p>Delphi 2009 has changes to the COM support, including a text-based replacement for the binary TLB files.</p>\n\n<p>You can read more on <a href="http://chrisbensen.blogspot.com/2008/07/tiburn-sneak-peek-com_23.html" rel="nofollow noreferrer">Chris Bensen\'s blog</a>.</p>\n'}, {'answer_id': 38470, 'author': 'Barry Kelly', 'author_id': 3712, 'author_profile': 'https://Stackoverflow.com/users/3712', 'pm_score': 3, 'selected': False, 'text': "<p>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 &amp; setters - there was some invariant that tlibimp expected but midl didn't guarantee.</p>\n\n<p>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.</p>\n"}, {'answer_id': 60380, 'author': 'Toby Allen', 'author_id': 6244, 'author_profile': 'https://Stackoverflow.com/users/6244', 'pm_score': 3, 'selected': False, 'text': '<p>We have also just installed Delphi 2009 and it does seem to have improved the support for Typelibraries.  However I have worked with COM and type libraries for quite some time and here are my general gotchas that I have found over the years.  I would agree its pretty buggy and is all the way up to Delphi 2006 (our version prior to using 2009).</p>\n\n<ul>\n<li>Always have every file writeable before opening.  This may sound obvious, but when working with source control sometimes we forget to do this and try to remove readonly flag after opening a file - Delphi cant deal with this.  Ensure tlb is writable before opening.</li>\n<li>If editing a standalone typelibrary you MUST have a project open.  For some reason if you open a type library on its own it will not save.  Create a blank project and then open your typelibrary.  For some reason this allows the type library to be saved.</li>\n<li>If your type library is used by an application or COM+ ensure that application is shut down or COM+ disabled before opening the type library.  Any open apps will prevent the type library from being saved.</li>\n</ul>\n\n<p>However I think your best solution is probably an upgrade. You get Unicode support too.</p>\n'}, {'answer_id': 96850, 'author': 'Paul-Jan', 'author_id': 16725, 'author_profile': 'https://Stackoverflow.com/users/16725', 'pm_score': 2, 'selected': False, 'text': "<p>Same experience with the TLB interface here: we simply stopped using it.</p>\n\n<p>We work with several separate IDL files (hand-build) for different parts of our framework, making use of the #include construct to include them into the IDL of the actual application, then generate the single tlb using MIDL and tlibimp it. If the application has no IDL of it's own, pre-compiled version of the different framework TLB files are available.</p>\n\n<p>Whenever the framework enters a new version, a script is run to re-generate the GUIDS on all necessary interfaces in the IDL files. </p>\n\n<p>This has served us well for many years, and for us to move over the new Delphi 2009 IDL/TLB toolset will have to be not only integrated into the IDE, but also versatile when it comes to automated builds and whatnot. Can't wait to get my hands dirty with some experiments!</p>\n"}, {'answer_id': 97264, 'author': 'skamradt', 'author_id': 9217, 'author_profile': 'https://Stackoverflow.com/users/9217', 'pm_score': 2, 'selected': False, 'text': "<p>Using Delphi 2009 has greatly taken much of the pain out of huge TLB files, and conversion of our existing objects was painless, but our com objects don't use any third party libraries.</p>\n\n<p>We will be migrating our gui applications over once the library vendors release supported versions.</p>\n"}]
['https://Stackoverflow.com/questions/16897', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2015/']