Trouble with C++ class Inheriting from a C# parameterized class with explicit interface implementation
- From: "Howard Swope" <hswopeATtrafficDOTcom>
- Date: Thu, 24 Jan 2008 17:02:42 -0500
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]
.
- Follow-Ups:
- Prev by Date: LNK4006 warning
- Next by Date: How do I call Win32 API functions SetClipBoardViewer, ChangeClipboardChain, etc, from C++ .NET app ?
- Previous by thread: LNK4006 warning
- Next by thread: Re: Trouble with C++ class Inheriting from a C# parameterized class with explicit interface implementation
- Index(es):
Relevant Pages
|