470,624 Members | 2,538 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,624 developers. It's quick & easy.

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 1428
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

22 posts views Thread by Matthew Louden | last post: by
1 post views Thread by George Durzi | last post: by
5 posts views Thread by Mike Labosh | last post: by
3 posts views Thread by Trammel | last post: by
reply views Thread by Adam Clauss | last post: by
4 posts views Thread by =?Utf-8?B?QkogU2FmZGll?= | last post: by
3 posts views Thread by =?Utf-8?B?TWF0dCBIZXNz?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.