I am going crazy on this problem for the past couple of weeks. I have a C# Com object that needs to send property change notifications to a C++ Com object. An equivalent in VB would be using code that looks as follows PropertyChanged "propertyName".
In C++ the equivalent to use the CFirePropNotifyEvent class from ATL.
The C++ COM and VB COM objects do not implement a specialized events interface, so the equivalent are give above.. The C++ COM object that needs to sink the event is based around IPropertyNotifySink, afaik.
What is the equivalent in C#? i have tried:
- INotifyPropertyChanged from System.ComponentModel
- I implemented IObjectWithSite and tried to cast the site object received in setSite to IPropertyNotifySink.
- I cannot find an equivalent for CFirePropNotifyEvent in C++/ATL which is what the C++ code uses..
Please help..
Thanks in Advance..
I don't think there is some automatic gateway between .NET's INotifyPropertyChanged and COM's INotifyPropertySink.
If you want a .NET object to provide COM events, you need to provide an implementation of IConnectionPointContainer in these .NET objects.
IConnectionPointContainer
already exists in .NET in theSystem.Runtime.InteropServices.ComType
s namespace.