InspectorEvents for Close on New Inspector (VC++)

T

Tobias Svensson

Hi
I have an C++ Outlook 2000 addin that has a sink for
Outlook::InspectorsEvents for olContactItems. On New Inspector Event I set
up a new sink to Outlook::InspectorEvents to be able to track when the
Inspector window is closed. I get Activate, Deactivate events as well as
Close event when I choose "File - Close" or clicking on close button in top
right corner of the contact item. So far so good. However when I click "Save
and Close" the Close event is never generated. I get a Deactivate event and
thats it. I need the Close event to free some resources.

Does anyone have an ide, what I am doing wrong. Seems strange that the Close
event is not generated when the item is saved.

/regards Tobias
 
T

Tobias Svensson

Hi
I found a soullution.
I changed the sink event from Outlook::InspectorEvents to
Outlook::ItemEvents. There is a Close event ( 0xf004 ) in
Outlook::ItemEvents also and it is triggered in all cases.

/Tobias
 
K

Kiran Kumar

HI Tobias,
Can you please tell me how to write a sink for ItemEvents

Thanks in advance
/kiran
 
D

David McAlister

You don't get a Close event because its not yet closed. Outlook does some
crazy caching, it will close the item as you have found, but it will keep
the inspector (somewhere) and use it again later. This can lead to very
unpredictable results if you are not careful - your event sink will remain
attached and will start to get events again when the inspector is reused !!!

Dave
 

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