none
Multiple MAPI session RRS feed

  • Question

  • Hi all,

    I am new to Extended MAPI. I got a request to build a c++ extended MAPI (No CDO/Redemption) client application that interacts with Exchange 2003 server to scan through multiple Outlook profiles and report (for now) on their calendar items/count. This was done successfully but still, a question remains…

    Currently, as I move from one profile to the other one (say from Profile1 to Profile2) I simply logoff (session->Logoff) from the previous one before login on (MAPILogonEx) the next one, under the same MAPIInitialize. Is this OK? Should I be doing a MAPIUninitialize after every Logoff/Release and a MAPIInitialize before every new session logon?

    Thanks,

    Tuesday, February 28, 2012 7:46 PM

Answers

  • If you initialize the MAPI system more than 500 or so times, most client versions of MAPI will break apart.

    To make sure the MAPI system stays initialized, call MAPIInitialize on startup - you can then call MAPIInitialize/MAPIUninitialize as many times as yo want.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.2 is now available!

    • Marked as answer by cr001 Tuesday, March 6, 2012 1:42 PM
    Monday, March 5, 2012 9:35 PM

All replies

  • No, call MAPIInitialize once when you iniitialzie and MAPIUninitialize when you are done.

    Also, do not use multiple profiles - create a profile for a user who can access the mailboxes in question, then add other maulboxes as delegagte mailboxes - doing so requires fewer privileges.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.2 is now available!

    Wednesday, February 29, 2012 7:38 AM
  • Hi Dmitry,

    I get your point with using only one account that gets delegated access to others mailboxes’ that requires scanning.

    The main reason why we decided using the multi profile approach is because we are trying to replace an existing mechanism that we know is currently setup and works this way.

    If we pursue using the multi profile approach (MAPIInitialize, Logon/work/Logoff sequence for about 600 mailboxes, MAPIUninitialize), are we aiming for problems such as performance or memory, as opposed to what you are suggesting ?

    Thanks,

    Wednesday, February 29, 2012 2:33 PM
  • If you initialize the MAPI system more than 500 or so times, most client versions of MAPI will break apart.

    To make sure the MAPI system stays initialized, call MAPIInitialize on startup - you can then call MAPIInitialize/MAPIUninitialize as many times as yo want.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.2 is now available!

    • Marked as answer by cr001 Tuesday, March 6, 2012 1:42 PM
    Monday, March 5, 2012 9:35 PM