Implementing Event Sinks in ATL 
Author Message
 Implementing Event Sinks in ATL

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?
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



Wed, 08 Sep 2004 06:47:03 GMT  
 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



Wed, 08 Sep 2004 07:46:40 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to Implement more than one Sink/Event Interface [ATL]

2. ATL DLL event sink with a VB ActiveX DLL event source

3. ATL COM Component firing events into VBScript event sink

4. Problem with ATL Sink class for catching another ATL's events

5. How to implement event sink using #import

6. Implementing Event Sink for ActiveX Automation Object in global namespace

7. implementing outproc server with sink entry using atl

8. ATL - sink event

9. COM client (MFC) using ATL to sink events ?

10. Event source and sink for COM without ATL or MFC

11. Dynamic Event Sink In ATL?

12. ATL Event Sink (DISP_E_MEMBERNOTFOUND)

 

 
Powered by phpBB® Forum Software