[英]How to fire property changed notifications from C# to COM using IPropertyNotifySink?
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.
我有一个C#Com对象,需要将属性更改通知发送到C ++ Com对象。 An equivalent in VB would be using code that looks as follows PropertyChanged "propertyName".
VB中的等效项将使用如下代码,该代码如下PropertyChanged“ propertyName”。
In C++ the equivalent to use the CFirePropNotifyEvent class from ATL. 在C ++中,等效于使用ATL中的CFirePropNotifyEvent类。
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. C ++ COM和VB COM对象没有实现专门的事件接口,因此在上面给出了等效的接口。需要接收事件的C ++ COM对象基于IfapertyNotifySink,即afaik。
What is the equivalent in C#? C#中的等效项是什么? i have tried:
我努力了:
Please help.. 请帮忙..
Thanks in Advance.. 提前致谢..
I don't think there is some automatic gateway between .NET's INotifyPropertyChanged and COM's INotifyPropertySink. 我认为.NET的INotifyPropertyChanged和COM的INotifyPropertySink之间没有自动网关。
If you want a .NET object to provide COM events, you need to provide an implementation of IConnectionPointContainer in these .NET objects. 如果希望.NET对象提供COM事件,则需要在这些.NET对象中提供IConnectionPointContainer的实现。
IConnectionPointContainer
already exists in .NET in the System.Runtime.InteropServices.ComType
s namespace. IConnectionPointContainer
在.NET中已经存在于System.Runtime.InteropServices.ComType
的命名空间中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.