[Prev][Next][Index][Thread]

Re: com and gcc question




 To my knowledge, you're not missing anything.
g++'s vtable layout is indeed not COM-compatible so you cannot compile
C++ code with g++ and expect it to work with the OSKit.

The last discussion I had with Jeff Law about this issue was a
while back.  He said then that enabling g++ to emit COM-compatible
vtables wasn't high on their priority list.  I don't know whether
this has changed since, but I think this question is better directed
at the egcs/gcc mailing list.

	- Godmar

> 
> I was going through the oskit code and the COM interface.  As a result,
> I thought I'd code in C++ for a small project since COM instantiation is
> supposed to work for both C and C++.  Problems arose when I decided to
> look at the code generated by gcc for a virtual class for COM and found
> that the vtable layout isn't correct.  Checking back with the Microsoft
> spec, it looks like they played the 700 pound gorilla trick and forced
> compiler writers to conform to the "Microsoft Object Model" format in
> order to make COM and C++ compilers work together.
> 
> Am I off base with this?  Do I need to write special classes for C++ in
> order to use gcc with the oskit COM objects?   Anyone have any pointers?
> 
> Pat
> 


References: