Trouble with C++ class Inheriting from a C# parameterized class with explicit interface implementation



I have implemented, in C#, a generic collection which has explicit interface
implementation

public abstract class DictionaryBase<TKey,TValue> :

IDictionary<TKey,TValue>,

ICollection<KeyValuePair<TKey,TValue>>,

IEnumerable<KeyValuePair<TKey,TValue>>,

IDictionary,

ICollection,

IEnumerable,

ISerializable,

IDeserializationCallback

{
...
}



If I try to inherit from this in C++ I get errors telling me that I am
missing implementations for some of my interface functions (errors listed
below). If within the same C# library I create a class that inherits from my
base class and then inherit from that in C++ everything works.

For example, I created the following class and then used this class from
which to inherit in C++. And everything works.

public class StringDictionaryBase : DictionaryBase<string, string>

{

public StringDictionaryBase()

{

}



}



Any ideas why I can't inherit directly from my DictionaryBase class???



Errors Received:

Error 2 error C3766: 'Hermes::Animation::ExtraDataCollection' must provide
an implementation for the interface method
'System::Collections::Generic::IEnumerator<T>
^System::Collections::Generic::IEnumerable<T>::GetEnumerator(void)'
c:\hermes\trunk\src\animation2\niwrapper\ExtraDataCollection.h 16

Error 3 error C3766: 'Hermes::Animation::ExtraDataCollection' must provide
an implementation for the interface method 'void
System::Collections::Generic::ICollection<T>::Add(System::Collections::Generic::KeyValuePair<TKey,TValue>)'
c:\hermes\trunk\src\animation2\niwrapper\ExtraDataCollection.h 16

Error 4 error C3766: 'Hermes::Animation::ExtraDataCollection' must provide
an implementation for the interface method
'System::Collections::Generic::ICollection<T>
^System::Collections::Generic::IDictionary<TKey,TValue>::Keys::get(void)'
c:\hermes\trunk\src\animation2\niwrapper\ExtraDataCollection.h 16

Error 5 error C3766: 'Hermes::Animation::ExtraDataCollection' must provide
an implementation for the interface method
'System::Collections::Generic::ICollection<T>
^System::Collections::Generic::IDictionary<TKey,TValue>::Values::get(void)'
c:\hermes\trunk\src\animation2\niwrapper\ExtraDataCollection.h 16

Warning 6 warning C4570: 'Hermes::Animation::ExtraDataCollection' : is not
explicitly declared as abstract but has abstract functions
c:\hermes\trunk\src\animation2\niwrapper\ExtraDataCollection.h 9


--
Howard Swope [hswope.swopeATnavteqDOTcom]
Senior Software Developer
Media Development
Navteq Traffic [http://www.traffic.com]


.



Relevant Pages

  • Re: Interface question
    ... This is the beauty of interfaces: you don't inherit from something ... interface, and make all of the classes implement it. ... ListViewModel, which is the brains behind managing item selection, ... to make another control that could interact with any control that was ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Interface question
    ... The interface it uses is IAnimal. ... in C# a class can only directly inherit one other class. ... Not all animals do make sounds, and so by doing it this way, all animals would have a common shared base class "Animal" that really is universal to all animals, while those that can intentionally make sounds would _implement_ the "IVocalize" interface themselves in whatever way was appropriate to that particular animal. ... it essentially enters into a contract with any code that might use an instance of a Student that it will implement the methods in those interfaces: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Pulling my hair out, I need some help
    ... The reason I said not Inherited was that the OP said "an Interface ... that all DLL need to inherit to use". ... is that the plug-in must meet. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Typed List
    ... In this special case you'll avoid boxing/unboxing, but IMHO, the public implementation should be primary and the explicit interface implementation should only adapt the interface method signature to the actual implementation. ... void Function; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Why Java interface?
    ... In C++, there are multiple inheritances; but in Java, a class can ... inherit only one super class. ... interface is ...
    (comp.lang.java.programmer)