On Thu, Jan 18, 2001 at 08:05:32AM -0600, Ken Kozman wrote:
> > Um, COM *does* provide a spec for this, because you have to be able to
> > use COM objects across compiler boundaries. AFAIK this is done as part
> > of the declaration specification magic. And again AFAIK (get me if i'm
> > wrong) XPCOM does this as well -- I assume it's folded into NSI_EXPORT
> > or whatever the declaration magic is for methods that are exported from
> > a DLL ...
> >
> > But by all means, don't believe me. Go look at the symbol table
> > yourself. MS used to ship a utility called QuickView (or maybe it came
> > with VC++) that could look at the symbols a dll provides ...
> >
> 
> It is my belief that COM does NOT provide this sort of mapping when you are
> exporting a class from a DLL, just when you are passing pointers to classes.
> The reason is the pointers only refer to the methods by an offset number
> (the virtual table) whereas the DLL exportation is done via a name (in this
> case a mangled name.) I'm about 99% sure of this, but I've never really been
> 100% sure of anything.
> 

Yes. I know what's going on now :) (i'm dumb).

Each compiler generates a differently named, but functionally equivalent and
interchangeable (vtable is identical). So if I compile with Watcom (and
include a header file), and I get passed a pointer to an IFoo, i can use
it just fine -- my copy of the vtable compile in Watcom is the same as the
version in the library compiled with VC (since it's a COM object).

But i *can't* just start calling random functions in the DLL -- they're
mangled wrong for me. But if I generate an object by calling CreateInstance
of some global component manager, I don't have to call any DLL functions,
since I can get around needing the constructor.

I'm pretty darn certain that's what's going on :)

...

So for using mozilla from another compiler ... i *assume* that XPCOM on
windows registers components in the system component registry (if i'm wrong,
forget it, this won't work :). Then everything should be fine, except that
you'll have to build any utility objects completely within (say) Watcom.
Assuming that all the utility objects use the right declaration magic (so
that they have COM vtable layout), passing those objects back and forth
should be fine.

That doesn't mean this *will* work :). The windows platform is seriously
moving towards compiler unity ...



ari

Reply via email to