Outlook 2000 Termination Hang

J

John Erickson

Hi,

I'm developing a Com Addin that works great on Outlook 2002, 2003, and 2007.
For the most part it also works for Outlook 2000 with one small problem. If I
have received a MAPI notification that a mail item was sent, then my
OnDisconnection method never gets called when Outlook terminates and Outlook
never terminates. I'm also not seeing the normal popup that says outlook is
shutting down when this happens.

I have uncovered other situations where my program wasn't terminating
properly in Outlook 2000. Those were specifically related to MAPI contents
table SetColumn calls I was making where I requested the columns be limited
to certain Unicode properties. Doing this caused my AdviseSink to never be
released and my program hung waiting for the Release to happen. I fixed these
issues by changing the contents table SetColumn calls to limit columns to
certain Ansi properties instead and then my Release got called on termination.

However, this fix did not solve the problems I am encountering with the
advise sink I have set on Sent Items Folder contents. For that folder I am
limiting the columns to the PR_DISPLAY_TO_A property so that I can see who
mail items are sent to.

The act of receiving an OnNotify call from a MAPI Advise Sink seems somewhat
unrelated to getting back an OnDisconnection notice during termination, so I
am at a loss to determine why this call is not happening.

For background information... I am spinning up a thread during the
OnConnection call that does all my MAPI work. I then have UI hooks that can
PostThreadMessages to my MAPI thread to have it do some work for it. My MAPI
thread is also monitoring changes to certain folders and the address book
through Advise sink mechanisms. Then during the OnDisconnection call I
gracefully shutdown my MAPI thread. But if the OnDisconnection call never
happens I can't shut down.

Anyone have any ideas?

John Erickson
 
J

John Erickson

Hi Again,

I just ran a test without my MAPI AdviseSink running for sent items and it
still hung without calling my OnDisconnection. Next I am going to review my
Outlook namespace events that I have hooked to see if there is something
happening there during a sent email.

John
 
J

John Erickson

Hi Again,

I think I'm getting closer. I'm not seeing an
Outlook::InspectorEvents::Close() event happen when the inspector window for
the mail I am sending closes. I do see Activate and deactivate events so I
know my event hook is working ok. Plus it works fine for Outlook versions >
2000. WIthout this notification I can't clean up event hooks and other
objects that I created when I received the
Outlook::InspectorsEvents::NewInspector notification. Is there another time
that I can clean up beside the Close() event? I considered cleaning up at
deactivate time, but I don't want my objects going away when the user simply
changes window focus.
 
J

John Erickson

One more thing I noticed. I do get a Outlook::InspectorEvents::Close() event
if the inspector window X button is hit. I just don't get one when the Send
button is hit. Is this a known problem with Outlook 2000 and is there a work
around for it?
 
K

Ken Slovak - [MVP - Outlook]

In some cases in Outlook 2000 sending won't fire Inspector.Close() but it
will fire item.Close(). In fact, that can also happen in certain specific
circumstances in Outlook 2002. See if also handling item.Close() helps.
 

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