[Mono-devel-list] COM Interop

Jonathan S. Chambers Jonathan.Chambers at ansys.com
Mon Jul 25 10:31:03 EDT 2005

	I am interested in implementing some support for COM Interop for
the mono runtime. A goal is that the mono version of COM Interop could
support various component models (COM, XPCOM, and Bonobo have been
proposed); whether more than one can be supported at one time is another
decision that someone will need to make.
	Component model specific code will not be part of the mono
runtime, but part of an external library loaded at runtime (as

A few questions

1. Would the mono runtime be aware of common functionality that exists
in all (currently proposed) component models; essentially the
functionality of the Unknown interface (reference counting and interface
2. As MS has a base COM object wrapper (__ComObject), I was planning a
similar one for mono. This wrapper would hold onto the unmanaged object
pointer and provide additional functionality as required. Does this
sound ok?
3. I assume some sort of reference counting will take place. For
simplicity, I was planning on AddRef'ing/Release'ing at every
interaction. This is different that the MS implementation, I believe.
For example, (again, I believe) MS keeps track of the IUnknown pointer
and addref's only once upon entry into the managed runtime. Each
unmanaged component then seems to be wrapped by only one managed
4. I assume each unmanaged interfaces will have a corresponding managed
interface defined and tagged with appropriate attributes. The
GuidAttribute would work for COM/XPCOM, but Bonobo takes a string for
its QueryInterface (Kornel mentioned having additional namespaces under
System.Runtime.InteropServices, such as


More information about the Mono-devel-list mailing list