On Tue, Jan 16, 2001 at 01:29:00PM -0600, Ken Kozman wrote:
> There is no COM CString implementation. There is the MFC CString, but that
> is just your typical Copy on Write string class.

yes. i am dumb. and haven't developed under windows in ... 3 years or so :)

> I don't understand what you mean about using __declspec, do you mean the
> calling convention of the methods of an object (__stdcall, etc.). You can

yes. that is what i mean. (see previous note about me being dumb).

> only pass interfaces and base types cross interface, otherwise you might
> come across some compiler incompatibilities. By using COM and IUnknown you
> are basically only passing virtual tables for everything, which are compiler
> independant (as long as you do not use multiple inheritance.) Another
> problem is you can not delete an object which is created from another
> compiler. How would you? You don't know how it's memory is managed or

right. but it should be fine (unless i'm dumber than even i think) to do
something like instantiate an object whose methods live in a library
compiled by another compiler.

it's clearly bad style to try to delete pre-instantiated objects you
received from some library somewhere; the code that created the object
should clean it up.

> anything. What's worse, the pointers or references to the classes you are
> passing back and forth could have different declared implementations on both
> sides of the interface. CString (as an example) on one side could have a
> method GetLength( ), and not have it in the header definition on the other
> side. So what happens if the side without creates a CString object, passes
> it across the interface boundary, and the guy on that side tries to call
> GetLength( ) on it?

but the headers *are* available ... so it should be deal-withable.

...

again, i'm inferring all of this from the preachings of the very Reverend
Booch/Gamma/Box :) but the theory of COM is to provide an object model that
allows use of C++ objects across library and compiler boundaries. All of COM
might be summed up in "The ISO C++ committee shoulda specified an object
model; and using lots of abstract base classes makes for good design".

I think we all agree here :) modulo my abuse of terminology. The real
questions are 
  a) does this work with mozilla in practice (worth trying, right? it
     *should*)
  b) are there dumb things mozilla does (like using non-portably declared
     objects) that break it. obviously, this stuff should be fixed.

be a shame to be totally XP but fail generality on a single platform due to
compiler woes. The Unix world is blessed with near-uniformity of compiler
(amusing to se the decl #define's for unix be blank :), but that's not a
reality for everyone else ...



ari

Reply via email to