Is Borland C++ COM compliant??

R

ramki

I need to access COM DLL from Borland C++.
I do not know if Borland C++ is COM compliant or not. I know that they
were bending over backward to be MFC compliant about 8 to 10 years ago
but I do not know if that includes COM. If it is compliant, which
version of Borland C++ we have to use?

Your input is greatly appreciated!!

Regards,
Rama
 
I

Ivan Vecerina

:I need to access COM DLL from Borland C++.
: I do not know if Borland C++ is COM compliant or not. I know that they
: were bending over backward to be MFC compliant about 8 to 10 years ago
: but I do not know if that includes COM. If it is compliant, which
: version of Borland C++ we have to use?

No, by default, it uses a different ABI (binary interface/code layout)
than what is mandated by COM.
Ask in a Borland forum to find out more...

hth-Ivan
 
R

Richard Herring

Ivan said:
:I need to access COM DLL from Borland C++.
: I do not know if Borland C++ is COM compliant or not. I know that they
: were bending over backward to be MFC compliant about 8 to 10 years ago
: but I do not know if that includes COM. If it is compliant, which
: version of Borland C++ we have to use?

No,

Where "no" means "yes, but".
by default, it uses a different ABI (binary interface/code layout)
than what is mandated by COM.

Only by default. It can generate COM-compatible code if you use the
appropriate constructs, or let its wizards generate them for you. (Been
there, done that, sold it to satisfied customers...)

Which is why it's better to
Ask in a Borland forum to find out more...

instead of the incomplete and possibly incorrect information you'll get
here.
 
M

marcwentink

ramki schreef:
I need to access COM DLL from Borland C++.

Long long time since I done this ... but I think the problem is the
name mangling difference between MVC++ and Borland. Mangling means that
to support overloading of method names in C++, MicroSoft VC++ and
Borland C++ Builder use different names and funny bits in names. If
your DLL only exists of pure C and hence the named functions do not
cantain this mangling, or how it was called, it can be done. This
because in pure C there is no function name overloading and hence no
mangling with funny parts in the function name.

Marc Wentink
 
M

Mike Smith

Richard said:
Where "no" means "yes, but".


Only by default. It can generate COM-compatible code if you use the
appropriate constructs, or let its wizards generate them for you. (Been
there, done that, sold it to satisfied customers...)

Which is why it's better to


instead of the incomplete and possibly incorrect information you'll get
here.


I know this is OT and therefore really naughty, but it's piqued my
curiosity because I'm currently reading Matthew Wilson's "Imperfect C++"
and there's a whole section on binary interoperability. By "binary
interface/code layout" above, are we talking about the arrangement of
the vtable layout and pointer?
 
I

Ivan Vecerina

: Richard Herring wrote:
: > In message <[email protected]>, Ivan
: >> : >> :I need to access COM DLL from Borland C++.
: >> : I do not know if Borland C++ is COM compliant or not. I know that
they
: >> : were bending over backward to be MFC compliant about 8 to 10 years
ago
: >> : but I do not know if that includes COM. If it is compliant, which
: >> : version of Borland C++ we have to use?
: >>
: >> No,
: >
: > Where "no" means "yes, but".
: >
: >> by default, it uses a different ABI (binary interface/code layout)
: >> than what is mandated by COM.
: >
: > Only by default. It can generate COM-compatible code if you use the
: > appropriate constructs, or let its wizards generate them for you.
(Been
: > there, done that, sold it to satisfied customers...)
: >
: > Which is why it's better to
: >
: >> Ask in a Borland forum to find out more...
: >
: > instead of the incomplete and possibly incorrect information you'll
get
: > here.
:
:
: I know this is OT and therefore really naughty, but it's piqued my
: curiosity because I'm currently reading Matthew Wilson's "Imperfect C++"
: and there's a whole section on binary interoperability. By "binary
: interface/code layout" above, are we talking about the arrangement of
: the vtable layout and pointer?

Yes, if I dare:

The MS COM specification requires a vtable made of a simple array of
function pointers. This is the approach that is most-easily emulated
by an array of C function pointers.
Its weakness, when using multiple inheritance, is that stub "trampoline"
functions need to be inserted to adjust the this pointer.

My guess is that Borland (just as Metrowerks used to do on the PowerPC
platform) uses the other popular form, where each vtable entry includes
both a function pointer and an offset to be applied to the this pointer.
[but I might be wrong regarding this point]

Another difference is that Borland's compiler, by default, uses different
parameter-passing conventions (e.g. using registers when possible).


And this is all good, but does required some extra effort when wanting
to interface with COM.


My 2 cents... Ivan
 
M

Mike Smith

Ivan said:
: Richard Herring wrote:
: > In message <[email protected]>, Ivan
: >> : >> :I need to access COM DLL from Borland C++.
: >> : I do not know if Borland C++ is COM compliant or not. I know that
they
: >> : were bending over backward to be MFC compliant about 8 to 10 years
ago
: >> : but I do not know if that includes COM. If it is compliant, which
: >> : version of Borland C++ we have to use?
: >>
: >> No,
: >
: > Where "no" means "yes, but".
: >
: >> by default, it uses a different ABI (binary interface/code layout)
: >> than what is mandated by COM.
: >
: > Only by default. It can generate COM-compatible code if you use the
: > appropriate constructs, or let its wizards generate them for you.
(Been
: > there, done that, sold it to satisfied customers...)
: >
: > Which is why it's better to
: >
: >> Ask in a Borland forum to find out more...
: >
: > instead of the incomplete and possibly incorrect information you'll
get
: > here.
:
:
: I know this is OT and therefore really naughty, but it's piqued my
: curiosity because I'm currently reading Matthew Wilson's "Imperfect C++"
: and there's a whole section on binary interoperability. By "binary
: interface/code layout" above, are we talking about the arrangement of
: the vtable layout and pointer?

Yes, if I dare:

Thanks for taking such a risk... ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,128
Latest member
ElwoodPhil
Top