Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / May 2006

Tip: Looking for answers? Try searching our database.

COM class - Exposure of public properties in a base class?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike Ross - 05 May 2006 18:36 GMT
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?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.