473,469 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Exposing COM & inheritance problems

First, I have ComVisible set to true for the entire assembly.

I have (abstract) base class A.
There are interfaces IA and IAEvents for accessing properties of this object
and exposing events.

[ClassInterface(ClassInterfaceType.None),
ComSourceInterfaces(typeof(IAEvents))
public abstract class A : IA
{
....
}

I then have a derived class B and an interface IB (IB also derives from IA).

public class B : A, IB
{
....
}

Given an instantiation of B, I can access (from COM) properties/methods
defined in either IA or IB.

However, when I then add a IBEvents (deriving from IAEvents) and change
class B to:

[ClassInterface(ClassInterfaceType.None),
ComSourceInterfaces(typeof(IBEvents))
public class B : A, IB
{
....
}

I can no longer access methods/properties defined from A/IA. Only those
defined at the B level. Is there some wierd trick with regards to
inheritance and COM that is preventing this? Is it still possible to do
what I want? I intend to have a great many classes deriving from A each with
their own unique set of properties and events in addition to the 'base' ones
defined in A. Ideas?

--
Adam Clauss

Sep 18 '06 #1
1 1555
Sorry - wrong newsgroup.

--
Adam Clauss

"Adam Clauss" <ca*****@tamu.eduwrote in message
news:12*************@corp.supernews.com...
First, I have ComVisible set to true for the entire assembly.

I have (abstract) base class A.
There are interfaces IA and IAEvents for accessing properties of this
object and exposing events.

[ClassInterface(ClassInterfaceType.None),
ComSourceInterfaces(typeof(IAEvents))
public abstract class A : IA
{
...
}

I then have a derived class B and an interface IB (IB also derives from
IA).

public class B : A, IB
{
...
}

Given an instantiation of B, I can access (from COM) properties/methods
defined in either IA or IB.

However, when I then add a IBEvents (deriving from IAEvents) and change
class B to:

[ClassInterface(ClassInterfaceType.None),
ComSourceInterfaces(typeof(IBEvents))
public class B : A, IB
{
...
}

I can no longer access methods/properties defined from A/IA. Only those
defined at the B level. Is there some wierd trick with regards to
inheritance and COM that is preventing this? Is it still possible to do
what I want? I intend to have a great many classes deriving from A each
with their own unique set of properties and events in addition to the
'base' ones defined in A. Ideas?

--
Adam Clauss

Sep 18 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Matt | last post by:
I have created an MDI child form that I am using as a base form in a VB.Net MDI application. The base MDI child form has a series of menu options on it. I then use this form to create other MDI...
22
by: Matthew Louden | last post by:
I want to know why C# doesnt support multiple inheritance? But why we can inherit multiple interfaces instead? I know this is the rule, but I dont understand why. Can anyone give me some concrete...
1
by: George Durzi | last post by:
I'm converting a c# web application to support page inheritance so that I can really change the look and feel of my application by only modifying the ..cs that my pages inherit from. The only...
6
by: VR | last post by:
Hi, I read about Master Pages in ASP.Net 2.0 and after implementing some WinForms Visual Inheritance I tryed it with WebForms (let's say .aspx pages, my MasterPage does not have a form tag itself...
5
by: Mike Labosh | last post by:
In VB 6, the Form_QueryUnload event had an UnloadMode parameter that let me find out *why* a form is unloading, and then conditionally cancel the event. In VB.NET, the Closing event passes a...
3
by: Trammel | last post by:
Hi, I recently upgraded to VB.net from VB6.. and woah... I feel lost :¬O One of my reasons for upgrading is I was told that VB.net can do class inheritance and subclassing easier. ...
0
by: Adam Clauss | last post by:
First, I have ComVisible set to true for the entire assembly. I have (abstract) base class A. There are interfaces IA and IAEvents for accessing properties of this object and exposing events. ...
4
by: =?Utf-8?B?QkogU2FmZGll?= | last post by:
We have a class that has a public property that is of type List<T>. FXCop generates a DoNotExposeGenericLists error, indicating "System.Collections.Generic.List<Tis a generic collection designed...
3
by: =?Utf-8?B?TWF0dCBIZXNz?= | last post by:
Does anyone know if there are plans to fix the Visual Inheritance problems for controls that use collections in Visual Studio 2008? I have installed Beta 2 and it is still not fixed.
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.