Thursday, April 19, 2007

Changes To COM In Delphi 2007

There are two major but small changes to the COM features in Delphi 2007:

1. The tlibimp default for ignore the CanCreate option has changed to on, -Yc+. The reason for the change is since introducing the option and not generating code for CoClasses that were marked to not be created we noticed that a lot of type libraries out there are not using that type library flag correctly.

2. COM Servers (this includes applications with a Remote Data Module) do not auto register themselves when run the first time. You must pass the /regserver paramter once in order to register it. The reason for the change is it should never have been auto registering in the first place, and because of UAC on Vista we had to change it.

2 comments:

Ralph Gielkens said...

Hello Chris,

We use BDS2006 and we have the following problem.

We have a Com object created with Delphi7 and the unit name is different from the saved file.

When we open the project in BDS2006 it doesn't work right. BDS2006 is asking to change the unit name to the file name and after that the com object doesn't work any more. When i add a procedure he doesn't add it etc. How can it be solved??

Greetings,

Ralph Gielkens.

Chris B. said...

Hi Ralph,

This should work. If you have a test case or steps to reproduce please send them to me. Just click the "contact me" link on the right side of the blog, put the word "blog" anywhere in the message so it gets to me faster.

What should happen is if you had Project1.dpr with Foo_TLB.pas and Foo.tlb it should end up being Project1.dpr, Project1_TLB.pas and Project1.tlb and the unit name should have been updated in Project1_TLB.pas to reflect the change. If you use the unit Foo_TLB anywhere the references should have been updated but there are cases, such as scoping and some references, were I didn't want to change user's code so you may have to change it yourself.

Post a Comment