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
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