OnDisconnection not firing during Debug

R

Ryan

I'm writing a COM add-in for outlook 11. I haven't compiled the
add-in yet but the OnDisconnection event wasn't firing during
debuging. So i followed some posts about Microeye's template and
ItemsCB. I put in a couple of msgbox's just to see if the
OnDisconnection was firing. In the compiled version it would fire but
during debug Microeye's OnDisconnection event won't fire as well. So
I compiled my add-in and the OnDisconnection event fires.

Is there someway to get it to fire during debug. Is there something I
have to configure? Thanks
 
M

Michael Hoehne

What programming language are you using and how do you debug? My COM Addins usually receive the OnDisconnection event in debug mode. I only have big problems when running a managed Addin and starting threads

Michael
 
K

Ken Slovak - [MVP - Outlook]

OnDisconnection will not fire when Outlook is closed until all Outlook
objects are released. It will fire in the case where a user disconnects the
addin from the COM AddIns dialog. Are you correctly trapping all the
Inspector and Explorer Close events and calling your UnInitHandler code from
there? I'd first set a breakpoint on the UnInitHandler code and once that
runs you should see OnDisconnection fire.
 
R

Ryan

Thanks for the replies. Ken I honestly don't think you sleep, how can
you when answering all these posts. Anyway what got me was I used the
MicroEye ItemDB class which you had mentioned in other posts. I
changed nothing in it, it is their original one. It calls the
OnDisonnect when I compile the add-in and run it as such so I would
think their code releases everything properly, but it doesn't call it
in debug mode so I was thinking maybe there was a setting I was
missing in VB.
I'm not sure why but today when I starting working from a cold boot
it starting calling the OnDisconnect in MicroEye's ItemsDB during
debug. Perhaps from one of the add-ins I was working on left a
reference and it effected MicroEye's ItemDB in debug? Not quite sure
but problem solved. Thanks
 
K

Ken Slovak - [MVP - Outlook]

Any addin that is connected would affect that since On_Disconnection will
only fire once all Outlook objects are released if the disconnection comes
from closing Outlook (RemoveMode = ext_dm_HostShutdown). That doesn't apply
if you uncheck an addin from the COM AddIns dialog (RemoveMode =
ext_dm_UserClosed).

Another thing that might affect what you are seeing is if you are running
something like ActiveSynch. That starts Outlook using automation (no UI) and
doesn't shut down when Outlook is closed (depending on the version of
Outlook) until you remove the PDA from its cradle.
 

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