Timing issue when sinking events from Inspector controls

M

Matt Fletcher

The addin that I am working on creates and attaches a handler each time it
receives a NewInspector. This handler should sink click events from various
controls in the Inspector window. The way that this handler was written by
my predecessor is to call DispEventAdvise for the various controls while
handling the Activate event - this puzzled me until I started playing with
the code , and found that if DispEventAdvise is called prematurely (e.g.
when constructing the handler) it will return S_OK, but no events will be
raised.

Thus my predecessor's strategy works fine, except in the situations where no
Activate event is raised - e.g. when using a custom form.

So my questions are:

1. why do the event sinks have to be created after the form has been
activated?
2. why are no Activate events raised when using our custom form?
3. are there any possible workarounds to either 1 or 2 ? (currently I'm
considering sub-classing the Inspector window using IOleWindow::GetWindow
and handling WM_ACTIVATE to take the place of the missing Activate event).

Thanks in advance
Matt Fletcher
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top