Board index » cppbuilder » Can BCB COM classes support interface updates/enhancements?

Can BCB COM classes support interface updates/enhancements?

I'm concerned that I've discovered a problem with BCB4, and the way it
handles changes/updates to COM interfaces that I create.

Here's a simple example

I create IFoo1, and implement it in MyClass. There is only one method
defined for IFoo1, abc(). A year later I create IFoo2, and want MyClass to
implement both IFoo1 and IFoo2. IFoo2 supports abc and xyz(). I want to
implement abc() differently when it's called via IFoo2 vs. IFoo1.

When I try to do this in BCB4, it seems like the type library editor and ide
will only generate skeleton code for the union of the two interfaces, i.e. I
get skeleton code for abc() and def(), whereas in a tool such as VB (please
hold the flames, I prefer BCB too...) I would get the following
implementation skeleton:

IFoo1_abc()
IFoo2_abc()
IFoo2_xyz()

So the question is, how the heck do I do the same thing in BCB4?

 

Re:Can BCB COM classes support interface updates/enhancements?


Carlton, you will need to do something like ATL does. You will need to
manually provide an implementation of the IFoo2 and add it to the list
of classes of your CoClass, adding it to the COM map also. I think it's
like this.

HTH,
Alex

Quote
"Carlton S." wrote:

[snip]
--
HotSend - portable documents technology
http://www.hotsend.com/
eFax - get your faxes via email - Free !
http://www.efax.com

Re:Can BCB COM classes support interface updates/enhancements?


Check out the section Handling Name Conflicts under the Interface Maps
chapter in ATL Internals by Rector and Sells.

have fun
--
Binh Ly
Visit my COM Notes at http://www.castle.net/~bly/com

Quote
Carlton S. <carl...@nospam.com> wrote in message

news:8142q3$sp314@forums.borland.com...
Quote
> I'm concerned that I've discovered a problem with BCB4, and the way it
> handles changes/updates to COM interfaces that I create.

> Here's a simple example

> I create IFoo1, and implement it in MyClass. There is only one method
> defined for IFoo1, abc(). A year later I create IFoo2, and want MyClass to
> implement both IFoo1 and IFoo2. IFoo2 supports abc and xyz(). I want to
> implement abc() differently when it's called via IFoo2 vs. IFoo1.

> When I try to do this in BCB4, it seems like the type library editor and
ide
> will only generate skeleton code for the union of the two interfaces, i.e.
I
> get skeleton code for abc() and def(), whereas in a tool such as VB
(please
> hold the flames, I prefer BCB too...) I would get the following
> implementation skeleton:

> IFoo1_abc()
> IFoo2_abc()
> IFoo2_xyz()

> So the question is, how the heck do I do the same thing in BCB4?

Other Threads