I did define an interface in C# with an event as:
[ComVisible(true), InterfaceType(ComInterfaceType.InterfaceIsDual), Guid("02F91299-B87C-47D2-B501-7768E767E012")]
public interface IFoo
{
event FooEventHandler FooEvent;
}
[ComVisible(true), Guid("2CB3858D-5729-47A1-B46B-C2C37C522E10")]
public delegate void FooEventHandler(IFoo sender, int status);
I have to implement this interface in an unmanaged C++ ATL DLL. The code class wizard proposes is:
STDMETHOD(add_FooEvent)(_FooEventHandler * value);
STDMETHOD(remove_FooEvent)(_FooEventHandler * value);
I see FooEventHandler as an IDispatch object. I do add/remove those _FooEventHandler * values into a list.
Now to my question: how do I fire/invoke this event for all stored _FooEventHandlers?
Thanks, Cabbi
UPDATE: I found the answer here: Exposing manged events to COM using C++