I have an object-oriented hierarchy of classes that I want to expose via COM
in a VB.NET 2005 project. It all works fine except for this:
The client program that uses the COM object can't see the public properties
and methods of the base classes from which the COM classes are derived.
IOW: I have a class called MyBase that has a public property called LoginID
and a public method called Login(). And I have a class called MyCOMClass
which inherits MyBase and is also defined as a COM class (has GUIDs and all
that). I am trying to call this COM object from a Progress program, and I
can see the MyCOMClass and all its public properties and methods, and I can
even see MyBase on the list of COM classes that gets displayed in the class
browser. But I can't see the LoginID property nor the Login function -
neither under the MyCOMClass, nor even under the MyBase class.
Does anybody have an idea why this is? Does COM not expose the members of
parent classes?
TDC - 05 May 2006 21:47 GMT
COM utilizes interface inheritence. It must be that the typelib
exporter/introp system does not pass inherited methods from a base
calls down into the interface it generates for the child.
You should be able to do this yourself though. Actually you should
always define an interface for your .NET classes that represents the
"COM" view of them, and as long as interface inheritence is exported
correctly then you'd be fine.
Tom
> I have an object-oriented hierarchy of classes that I want to expose via COM
> in a VB.NET 2005 project. It all works fine except for this:
[quoted text clipped - 13 lines]
> Does anybody have an idea why this is? Does COM not expose the members of
> parent classes?