"Mike Smith" <mi************ *****@acm.org> wrote in message
news:12******** *****@news.supe rnews.com...
: Richard Herring wrote:
: > In message <6b************ *************** @news.hispeed.c h>, Ivan
: > Vecerina <IN************ *****@ivan.vece rina.com> writes
: >> "ramki" <ra**********@g mail.com> wrote in message
: >> news:11******** *************@y 43g2000cwc.goog legroups.com...
: >> :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 interoperabilit y. 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
--
http://ivan.vecerina.com/contact/?subject=NG_POST <- email contact form