Re: Hosting any ActiveX control and receiving any events.
<null.function@gmail.com> wrote in message
news:1159650224.830881.110690@c28g2000cwb.googlegroups.com
3. Enumerating events and Receving.
Unfortunately, I don't know how to enumerating and receiving general
events from general ActiveX control. Since, any ActiveX control could
be hosted, I can't write such as BEGIN_SINK_MAP.
You need an object that implements IDispatch. This object should take an
IID as a parameter, and respond with its IDispatch implementation for
QueryInterface calls for IUnknown, IDispatch and this IID. Use
AtlGetObjectSourceInterface to determine an object's default source
(outgoing, event) interface, initialize your sink with this IID, and
advise it with AtlAdvise.
The sink object should implement Invoke - it would be called when an
event is fired. You would need to parse the hosted object's type info in
order to meaningfully interpret DISPIDs and parameters passed to Invoke.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925