Inherit a class by a class that should be marchal be reference
Hi!
I think this is a simple question for those that have been working with remoting for some time. And somehow, I believe the answer will be simply 'NO'

.
Is it possible to have a class that is marshal by reference and also inherits another class, other thanMarshalByRefObject?I guess that if that other class inheritsMarshalByRefObject, this would do the job. But what if that other class is not mine, let's say... a system class. For instance, can I have a class that inherits the Generic.Dictionary and be marshal by reference a the same time?
[667 byte] By [
papadi] at [2008-2-8]
The .Net languages support inheriting from one class, only, but implementing as many interfaces as needed. In short, it will not be possible to inherit from MarshalByRef AND another class. Even if you iherit from a class that inheritd from MarshalByRef, you still cannot inherit from another class at the same time.
Mitch
http://www.enterpriseetc.com
...say something new Mitch. That is the reason I made the question. If I thought that a class could inherit two classes, I wouldn't have asked.
My question simplyfied:
Is it possible to create a class A that inherits another class B (not MarshalByRefObject) and still use class A as marshal by reference?
I didn't mean to oversimplify the problem, but the fact remains that being able to inherit from only one class is the root of the problem and the reason why the answer to your question is no.
To obtain MarshalByRef behavior, you must inherit from MarshalByRef. At that point, you cannot inherit from another class. If it were possible to implement an interface to make a class MarshalByRef your problem would be solved, but I'm not aware of any interface that provides that ability.
Mitch
www.enterpriseetc.com
This would be a solution to some cases, where I have access to Class A code so that I can add the inheritance, as I mention in my first post.
I guess that I won't be able to do the same if I want my class to inherit a System class, like Dictionary class.
by the way...thank you both...