Adam Nathan in his book ".NET and COM" demonstrates how to hook up events from a C# library to a COM client, but the client code is shown only with a VB sample--I need C++.
The C# client implements the Phone class:
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface IPhoneEvents
{
[Dispid(1)] void Ring();
}
public delegate void RingEventHandler();
[ComSourceInterfaces(typeof(IPhoneEvents)]
public class Phone
{
public event RingEventHandler Ring;
...
}
The VB client looks like this:
Private WithEvents myPhone As Phone
Private Sub IPhoneEvents_Ring()
...
End Sub
I need to do what the VB class is doing but with unmanaged C++, but I can't find any good samp开发者_如何学Pythonles. Can anyone point me in the right direction?
TIA
精彩评论