> On Tue, Jan 16, 2001 at 08:58:26AM +0100, Valeri Todorov wrote:
> > Perhaps I didn't express myself very well. Yes, you are absolutely right about 
> > what you saying, but what I had in mind is that you need to create an instance 
> > of an object somehow. The problem arise that you have to use expressions like 
> > nsComponentManager::CreateInstance. If library module containing this method 
> > is compiled with one compiler, and you try to use it from an application 
> > written with different one, then you will get a link error. On the other hand, 
> > if the previous statement is declared like 
> > extern "C" NS_RESULT nsCreateInstance(arg,arg) then things become compiler 
> > independent as long as compiler support vtbl compatible with one used to build 
> > mozilla itself.
 
> nsComponentManager::CreateInstance is a static function. Those work fine
> afaik -- the calling convention is the same as for C functions.
What I had in mind, is that in source this is a static function, but in export 
lib (or in DLL itself) it looks like 
nsComponentManager::CreateInstance@SomethingElseCompilerSpecific and this will 
prevent this DLL/LIB to be linked to code compiled with other compilers. What 
I had in mind, that register/unregister/unload/classcreate functions should be 
defined as pure C API, somthing like Microsoft's DllRegisterServer or 
DllGetClassObject. Those functions are exported with that names and they can 
be used by any compiler.

This means that if mozilla will be compiled with Watcom (for example) this 
mean that my project will have to be made with Watcom too. Or the opposite - 
if I intend to use Watcom C/C++ compiler as a primary compiler, I won't be 
able to use mozilla with it
 
-- 
--
Regards,
Waleri

Reply via email to