OnBeginShutdown doesn't fire

W

Water Cooler v2

I've created three Outlook add-ins in the last one year using VB.NET.
With all the three, the problem has been that when I close Outlook
after using it, Outlook still hangs around in the memory and I have to
go to the task manager and shut down the process Outlook.exe.

It looks like one or more of the objects from my add-in does not get
cleaned/collected and hence the add-in does not get unloaded causing
OUTLOOK.EXE to stay in memory for longer than expected. And OUTLOOK
just stays and stays and stays there until you kill it.

I've checked thoroughly. None of my objects have valid references to
anything. On OnStartupComplete, I create a few menu items on the
Outlook menu and a few tool bar buttons on the Outlook standard tool
bar. They are all temporary controls as in they have their Temp
property set to True, so they are supposed to remove themselves.

All other objects I create of my own UDTs, I clean myself by setting
their references to Nothing JIT just after use.

I clean up references to the menus and toolbars I created, just in
case, in the OnBeginShutdown. But the event does not even fire.
Something wierd happens in between the user clicking the cross button
on the Outlook title bar's control box and the OUTLOOK.EXE staying
resident in memory.

I am using Outlook 2000 on Windows 2000 Professional with SP4. What's
happening here? Any thoughts would be appreciated.
 
K

Ken Slovak - [MVP - Outlook]

You need to trap the Explorer.Close event (and Inspector.Close) and see if
there are no more Inspectors or Explorers in each event. If so then release
all your objects, call to MarshalReleaseCOMObject and explicitly call the
garbage collector. That should force On_Disconnection to fire (as well as
the shutdown event).
 

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