AddHandler, RemoveHandler

  • Thread starter Thread starter Urs Vogel
  • Start date Start date
U

Urs Vogel

Hi

I need to detect wether an event handler has been added to an (Word object
Quit) event.

Question 1: How do I look up the event handler queue of an event, either
native .Net or COM interop?
Question 2: Does the AddHandler function add the handler mutliple times, or
does it automatically overwrite previously attached handlers? If the latter
is the case, the problem would be solved, but I couldn't find any comments
in MSDN regarding this issue.

Any hints are appreciated.

Thanks, Urs
 
Urs,
Question 1: How do I look up the event handler queue of an event, either
native .Net or COM interop?

If you ahve access to the event's underlying delegate, you can call
GetInvocationList() on it. It's usually only accessible within the
class that declares the event.

Question 2: Does the AddHandler function add the handler mutliple times

Yes



Mattias
 
Back
Top