Re: Default Implementation for IUnknown
"Stefan Weber" <stefan.weber@gmail.com> wrote in message
news:1178698804.267848.166720@w5g2000hsg.googlegroups.com
A callback object usable with attachEvent is completely different
from an event sink attached with the connection point. The latter
does need to implement DIID_HTMLElementEvents2 and handle events
with various DISPIDs like DISPID_HTMLELEMENTEVENTS2_ONCLICK. The
former does not and does not. Its Invoke implementation is only ever
called with a DISPID of DISPID_VALUE.
And how did you find that out?
Programming is an experimental science.
From the MSDN reference I could not
figure that out. Actually, I was thinkin that pub_onclick/attachEvent
connect to an connection point in the background anyway.
Note that a connection point supports multiple events - all events on a
particular source interface. attachEvent and put_eventName register a
handler for a single event only.
For example,
I tried to fetch a connection point for the HTMLElementEvents
interface from a div element and it worked, so I assumed that it is an
ordinary connection point.
HTML elements do support regular connection points. You can advise your
sinks to them with IConnectionPoint::Advise. You chose to go a different
route. I don't quite understand what you are complaining about.
Since the callback does not implement any particular named
dispinterface
According to the reference HTMLElementEvents2 is a dispinterface
(http://msdn2.microsoft.com/en-us/library/aa769636.aspx). So I assumed
that I have to implement this in ordert to catch its events.
But you are not advising to a connection point corresponding to
HTMLElementEvents2 source interface, so what again does it have to do
with anything?
--
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