Why doesn't Outlook ever ask for ApplicationEvents interface?

E

Eric

I'm writing a COM add-in for Outlook, but I assume this is the same
for any Office add-in, so hopefully no one gets upset that I posted
this question here.

I implemented the COM interface for IApplicationEvents, which I have
managed to setup an advise sink to get events. All of this works
fine. I just wonder why Outlook always calls QueryInterface() on my
COM object and requests the IDispatch interface instead of the
IApplicationEvents interface. Has anyone noticed this? Does anyone
know why this works this way?

I implemented IDispath::Invoke() of course, and this is what Outlook
ends up calling to notify me of events, and it works fine. I just
wonder if I really need to implement IApplicationEvents also, because
if Outlook never uses this interface, it seems like a waste to
implement, and it will amount to a bunch of untested code.

The way I understand COM, Outlook could call my
IUnknown::QueryInterface method to find out that I support the
IApplicationEvnets interface, and then make direct function calls,
instead of going the IDispatch() method.
 

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