
Implementing Event Sinks in ATL
See "ATLEventHandling: Demonstrates Using IDispEventImpl and
IDispEventSimpleImpl to Handle Word Events" at
http://msdn.microsoft.com/library/en-us/vcsample98/html/vcrefatleventhan
dlingsample.asp
and KB Article Q194179 "SAMPLE: AtlEvnt.exe Creates ATL Sinks Using
IDispEventImpl". The code for the sample is at
http://msdn.microsoft.com/code/sample.asp?url=/MSDN-FILES/026/001/698/ms
dncompositedoc.xml
--
With best wishes,
Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
Quote:
> I'm looking for a good example on implementing an event sink in ATL.
Most
> of the tutorials I've found whimp out when it comes to this part of
> connection points. As far as I can tell, the wizards don't do this
for you.
> I've used them to implement a connection point interface. I've seen
several
> different ways to accomplish event sinks but I want to know the best
way in
> ATL today. For example, why use IDispEventImpl vs.
IDispEventSimpleImpl?
Quote:
> It looks like I can derive any class from this and be able to handle
events,
> correct? I thought originally that the client had to be a COM object
to do
> so because IUnknown was required. What's the best way to advise and
> unadvise? It looks like DispEventAdvise and DispEventUnadvise are the
> easiest ones. My Beginning ATL book just isn't cutting it.
> I'm having problems getting my event sink to work (as I posted below)
and
> need to see a working example. I can get events called correctly when
the
> event handler doesn't accept parameters. When the method takes
parameters,
> I run into trouble.
> Thanks so much.
> -Chris