Board index » cppbuilder » Interfacing with MSVC++ COM service, vtable only, help!

Interfacing with MSVC++ COM service, vtable only, help!

Hello,

I am interfacing with a COM service written in MSVC++.  I imported the
MSVC generated type library (TLB).  I am taking code from a MSVC++ test
client sample and copying it into BCB 4.  The problem I'm having is:

1) I had to include the MSVC ATL base header file because of the heavy
use of MSVC ATL (ATLBase.h) defines in the test client code.
2) This has led to a flurry of "multiple declaration" errors when I
compile the code, for example:

[C++ Error] comcat.h(155): E2015 Ambiguity between 'IEnumGUID' and
'Activex::IEnumGUID'.
[C++ Error] comcat.h(163): E2238 Multiple declaration for 'IEnumGUID'.

How do I rectify this without having to massacre the test client code I
pasted into the BCB 4 project?  Any other interface tips would be
appreciated.

Thanks.

 

Re:Interfacing with MSVC++ COM service, vtable only, help!


It seems that some headers are included twice. Maybe some #ifdefs are in
order...

Alex

Quote
Webtech Host wrote:

> Hello,

> I am interfacing with a COM service written in MSVC++.  I imported the
> MSVC generated type library (TLB).  I am taking code from a MSVC++ test
> client sample and copying it into BCB 4.  The problem I'm having is:

> 1) I had to include the MSVC ATL base header file because of the heavy
> use of MSVC ATL (ATLBase.h) defines in the test client code.
> 2) This has led to a flurry of "multiple declaration" errors when I
> compile the code, for example:

> [C++ Error] comcat.h(155): E2015 Ambiguity between 'IEnumGUID' and
> 'Activex::IEnumGUID'.
> [C++ Error] comcat.h(163): E2238 Multiple declaration for 'IEnumGUID'.

> How do I rectify this without having to massacre the test client code I
> pasted into the BCB 4 project?  Any other interface tips would be
> appreciated.

> Thanks.

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

Re:Interfacing with MSVC++ COM service, vtable only, help!


Alex,

Are you sure?  It only happens when I include the MSVC header file
ATLBase.h.  Would they be including COMCAT.H?

Thanks.

Quote
Alex Bakaev [TeamB] wrote:
> It seems that some headers are included twice. Maybe some #ifdefs are in
> order...

> Alex

<snip>

Re:Interfacing with MSVC++ COM service, vtable only, help!


I'm not sure you need to include atlbase.h as it's most likely has been
included already by the BCB headers.

Alex

Quote
Webtech Host wrote:

> Alex,

> Are you sure?  It only happens when I include the MSVC header file
> ATLBase.h.  Would they be including COMCAT.H?

> Thanks.

> Alex Bakaev [TeamB] wrote:

> > It seems that some headers are included twice. Maybe some #ifdefs are in
> > order...

> > Alex

> <snip>

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

Re:Interfacing with MSVC++ COM service, vtable only, help!


Alex,

Then perhaps the BCB version of ATLBASE.H is incomplete?  The reason I included
it is because there were several defines used in the MSVC test client code that
I imported into BCB that I traced back to MSVC's ATLBASE.h.

Thanks.

Quote
Alex Bakaev [TeamB] wrote:
> I'm not sure you need to include atlbase.h as it's most likely has been
> included already by the BCB headers.

> Alex

> Webtech Host wrote:

> > Alex,

> > Are you sure?  It only happens when I include the MSVC header file
> > ATLBase.h.  Would they be including COMCAT.H?

> > Thanks.

> > Alex Bakaev [TeamB] wrote:

> > > It seems that some headers are included twice. Maybe some #ifdefs are in
> > > order...

> > > Alex

> > <snip>

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

Re:Interfacing with MSVC++ COM service, vtable only, help!


So what happened when you just tried to compile MSC code in BCB ? Before
you changed anything ?

Alex

Quote
Webtech Host wrote:

> Alex,

> Then perhaps the BCB version of ATLBASE.H is incomplete?  The reason I included
> it is because there were several defines used in the MSVC test client code that
> I imported into BCB that I traced back to MSVC's ATLBASE.h.

> Thanks.

> Alex Bakaev [TeamB] wrote:

> > I'm not sure you need to include atlbase.h as it's most likely has been
> > included already by the BCB headers.

> > Alex

> > Webtech Host wrote:

> > > Alex,

> > > Are you sure?  It only happens when I include the MSVC header file
> > > ATLBase.h.  Would they be including COMCAT.H?

> > > Thanks.

> > > Alex Bakaev [TeamB] wrote:

> > > > It seems that some headers are included twice. Maybe some #ifdefs are in
> > > > order...

> > > > Alex

> > > <snip>

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

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

Re:Interfacing with MSVC++ COM service, vtable only, help!


Alex,

I got a lot of compiler errors due to undefined MSVC->ATL terms like A2W(),
TypeSafe_QI, etc.

Thanks.

Quote
Alex Bakaev [TeamB] wrote:
> So what happened when you just tried to compile MSC code in BCB ? Before
> you changed anything ?

> Alex

> Webtech Host wrote:

<snip>

Re:Interfacing with MSVC++ COM service, vtable only, help!


Hmm, I wonder if the source in question makes explicit use of ATL 3.0.
BCB4 ships with ATL 2.0

Alex

Quote
Webtech Host wrote:

> Alex,

> I got a lot of compiler errors due to undefined MSVC->ATL terms like A2W(),
> TypeSafe_QI, etc.

> Thanks.

> Alex Bakaev [TeamB] wrote:

> > So what happened when you just tried to compile MSC code in BCB ? Before
> > you changed anything ?

> > Alex

> > Webtech Host wrote:

> <snip>

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

Other Threads