Which method is fired when Outlook closes ?

A

A. Tam

Hello,

I have a problem with my COM Addin. It causes Outlook to
stay in memory because some interfaces are not released. I
release them in OnDisconnection, but it does not work.

Where should I release these interfaces ?

Thank you for your kind responses

Arnaud
 
K

Ken Slovak - [MVP - Outlook]

On_Disconnection is a Catch 22 event. It won't fire unless all your Outlook
objects have already been released. You will need to monitor for the
Explorer and Inspector Close events and release all your objects when the
last Explorer/Inspector is closing.

See the VB 6 COM addin template ItemsCB for code that does that and works
around various other Outlook bugs. That can be downloaded from the Resources
page at www.microeye.com
 
G

Guest

I am using VC++ and this VB Code is not very helpfull to me.

Should it be that I would have to monitor every Explorer or
Inspector creation to attach the Event handler for Close to
each newly created Explorer/Inspector ?
 
K

Ken Slovak - [MVP - Outlook]

Yes. In VB terms we create a class that is instantiated each time a new
Inspector or Explorer is opened. A separate class for each. We then store
those in a collection. In the class modules we handle events for the
Inspector or Explorer in the class. That way we handle correctly events for
separate items. When there are no more Explorers or Inspectors (check for
Explorers by looking for an ActiveExplorer) then we release all Outlook
objects and then On_Disconnection will fire.
 

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