Extended MAPI calls on 2nd thread?

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

Is it okay to make Extended MAPI calls on a 2nd thread from a COM
add-in? I use MapiLogonEx() to get the IMAPISession pointer on the
main thread, which I work with it on the main thread as well, but now
I'm working on another process which I'd like to do on a 2nd thread.
Can I use the same pointer on the 2nd thread as well, or do I need to
call any init/logon functions again from the 2nd thread? I know MAPI
can be used with multiple threads, but I think it depends on how you
initialize it, and in this case Outlook is doing most of the
initialization for me, so thought I'd check with the experts...
 
Yes, you should be Ok as long as you don't forget to wrap the thread into
MAPIInitialize/MAPIUninitialize.
BTW, you can retrieve IMAPISession from OOM using Namespace.MAPIOBJECT in
Outlook 2002 and up.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Thank you. The 2nd thread is working like a champ. I haven't added
the init/deinit calls yet, but I will, since it seems like a good
practice.
 
Back
Top