Note that there are some explanatory texts on larger screens.

plurals
  1. POC++/CLI: Implementing an abstract C# class that implements INotifyPropertyChanged results in C++ compiler error C3766
    text
    copied!<p>I'm trying to implement an abstract C# class in C++/CLI. This abstract base class is already implementing INotifyPropertyChanged and as mentioned written in C#:</p> <pre><code>public abstract class BaseClass : INotifyPropertyChanged </code></pre> <p>In the C++/CLI assembly, I do have another interface that implements INotifyPropertyChanged:</p> <pre><code>public interface class IAnotherNotifyPropertyChangedClass : public INotifyPropertyChanged </code></pre> <p>Now, when inheriting from the abstract C# class BaseClass and implementing IAnotherNotifyPropertyChangedClass in C++/CLI I get the following:</p> <pre><code>public ref class AnotherNotifyPropertyChangedClass : public BaseClass, public IAnotherNotifyPropertyChangedClass </code></pre> <p>This results then in following compiling error:</p> <pre><code>error C3766: 'AnotherNotifyPropertyChangedClass' must provide an implementation for the interface method 'void System::ComponentModel::INotifyPropertyChanged::PropertyChanged::add(System::ComponentModel::PropertyChangedEventHandler ^)' </code></pre> <p>As soon as I remove the INotifyPropertyChanged from IAnotherNotifyPropertyChangedClass interface declaration, everything compiles fine. Why is that? This declaration would compile fine when using C#. I'm using VS 2012 and compile a .NET 3.5 mixed mode assembly.</p> <p>Thanks in advance!</p> <p>Cheers!</p> <p>Edit: Similar problem (w/o C#) here: <a href="http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/3047b8d1-348c-4ca6-b3f3-c396c03fedf7/" rel="nofollow">http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/3047b8d1-348c-4ca6-b3f3-c396c03fedf7/</a> So is this behavior in C++/CLI by design?!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload