none
Public Folder displayed as a message store in MFCMAPI when mailbox is opened and Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1 March 2014 Update is installed RRS feed

  • Question

  • Hi everyone,

    I have a doubt when using MFCMAPI. I have installed Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1 March 2014 Update and created a profile using MFCMAPI. I have opened a mailbox using MFCMAPI. The result is shown in first snapshot.

    I have another computer where Microsoft Outlook is installed and I have created a profile using it. I have opened same mailbox using MFCMAPI. The result is shown in second snapshot.

    Why there is difference between the two scenarios? Kindly explain. Also, kindly advise how to solve this problem.

    Thanks & regards,

    Talib Hussain



    Tuesday, June 3, 2014 7:00 AM

Answers

  • Standalone version of MAPI and older versions of Outlook: they always assume that you always have the primary mailbox and the PF store:

    Newer versions of Outlook: they only assume that you have the primary mailbox in the profile. When they connect to Exchange and it turns out there really is the PF store, it is shown in the stores table. But MFCMAPI never touches the primary store before you see the list of stores, hence you only see if the primary mailbox but not the PF store even if it is really there.


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


    Monday, June 9, 2014 6:14 AM

All replies

  • Hello,

    Did you configure the cached or non-cached exchange mode in both cases?

    Anyway, see How to create MAPI profiles without installing Outlook for more information.

    Tuesday, June 3, 2014 8:07 AM
  • Hi Eugene,

    Both cached and non-cached exchange mode gives the same result as shown in second snapshot. But I didn't get your explanation about cached and non-cached exchange mode which can be done only when Microsoft Outlook is installed.

    Thanks & regards,

    Talib Hussain

    • Edited by talib2608 Tuesday, June 3, 2014 1:11 PM
    Tuesday, June 3, 2014 1:11 PM
  • The explanation is located in the source code of the MFCMAPI. See MFCMAPI as a Code Sample and MFCMAPI on codeplex.com.
    Tuesday, June 3, 2014 2:25 PM
  • Starting with Exchange 2010, Public Folders store is optional. Outlook does not assume it is present until it actually connects to the server and it tells Outlook that the PF store is present.

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

    Tuesday, June 3, 2014 9:46 PM
  • Hi Dmitry,

    The snapshots that I have posted are of Exchange 2007.

    And, I didn't get your explanation.



    • Edited by talib2608 Wednesday, June 4, 2014 1:19 PM
    Wednesday, June 4, 2014 1:18 PM
  • Outlook does not know what version of Exchange you are using unless you actually connect to the server.


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

    Wednesday, June 4, 2014 1:33 PM
  • Hi Dmitry,

    I know that. Outlook couldn't know beforehand which version of Exchange it will be connected to. Outlook can only know about the version of Exchange after connecting to it. But the problem here is the public folder which you can see in the first row of the first snapshot when profile is created with MFCMAPI. Not with Outlook. Why is this public folder being shown?


    • Edited by talib2608 Thursday, June 5, 2014 3:42 AM
    Thursday, June 5, 2014 3:41 AM
  • Because Outlook and standalone (Exchange) versions of MAPI behave differently.


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

    Thursday, June 5, 2014 4:09 AM
  • Hi Dmitry,

    OK.

    So, the application that I am developing is to find the name of attachment whenever anyone sends an email using an email client which is connected to Exchange Server. So, I am implementing Advise Notifications on the message store. For that I am using the following code:

    if ( hr == S_OK )
    	hr = HrQueryAllRows( messageStoresTable, NULL, NULL, NULL, NULL, &messageStoresTableRowSet );
    
    for ( ULONG i = 0; i < messageStoresTableRowSet->cRows; i++ )
    	if ( hr == S_OK )
    		hr = mapiSession->OpenMsgStore( NULL, messageStoresTableRowSet->aRow[i].lpProps->Value.bin.cb, ( LPENTRYID ) messageStoresTableRowSet->aRow[i].lpProps->Value.bin.lpb, NULL, NULL, &messageStore );

    And it fails in OpenMsgStore() when i = 0, as shown in first snapshot.

    • Edited by talib2608 Thursday, June 5, 2014 4:44 AM
    Thursday, June 5, 2014 4:33 AM
  • After you open the primary mailbox, try to retrieve the stores table again - if the PF store is available, it will be there.

    But the PF store won't work for you anyway - it does not support store-wide notifications. The best you can do is notifications on a particular folder.

     


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

    Thursday, June 5, 2014 3:03 PM
  • Hi Dmitry,

    Would you elaborate more? I feel the solution provided by you wouldn't make any difference.

    For now, I am implementing notifications on the default store.

    restriction.rt = RES_BITMASK;
    restriction.res.resBitMask.relBMR = BMR_NEZ;
    restriction.res.resBitMask.ulPropTag = PR_RESOURCE_FLAGS;
    restriction.res.resBitMask.ulMask = STATUS_DEFAULT_STORE;
    
    if ( hr == S_OK )
    	hr = HrQueryAllRows( messageStoresTable, NULL, &restriction, NULL, NULL, &messageStoresTableRowSet );
    Can this code fail? Is there a chance that I have another mailbox store from which I can send emails and still could not be notified about the attachments being sent if I implement the above code?

    • Edited by talib2608 Friday, June 6, 2014 5:37 AM
    Friday, June 6, 2014 4:14 AM
  • I usually create a restriction on PR_DEFAULT_STORE = true, but I guess that should work too.

    Your code above does not set up any advise sinks; how do you do that?


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

    Friday, June 6, 2014 6:12 AM
  • Hi Dmitry,

    I followed msdn.microsoft.com/en-us/library/cc839617(v=office.12).aspx .

    I set up Advise sinks in my code. I didn't post the full code here.

    Could you explain your previous reply?

    And, also the behavior of profile created using Outlook and using Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1 March 2014 Update.


    • Edited by talib2608 Friday, June 6, 2014 11:14 AM
    Friday, June 6, 2014 10:26 AM
  • I am not sure what you are asking.


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

    Friday, June 6, 2014 2:06 PM
  • Hi Dmitry,

    The main question of this thread was all that I wanted to know.


    • Edited by talib2608 Monday, June 9, 2014 3:47 AM
    Monday, June 9, 2014 3:43 AM
  • So did I answer you question?


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

    Monday, June 9, 2014 3:53 AM
  • Hi Dmitry,

    It isn't still clear how Outlook and standalone (Exchange) versions of MAPI completely gives different results.

    • Edited by talib2608 Monday, June 9, 2014 6:12 AM
    Monday, June 9, 2014 6:09 AM
  • Standalone version of MAPI and older versions of Outlook: they always assume that you always have the primary mailbox and the PF store:

    Newer versions of Outlook: they only assume that you have the primary mailbox in the profile. When they connect to Exchange and it turns out there really is the PF store, it is shown in the stores table. But MFCMAPI never touches the primary store before you see the list of stores, hence you only see if the primary mailbox but not the PF store even if it is really there.


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


    Monday, June 9, 2014 6:14 AM
  • Hi Dmitry,

    What I did now is I have installed Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1 March 2014 Update and created a profile using MFCMAPI of a mailbox.

    After that I uninstalled Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1 March 2014 Update and installed Microsoft Outlook 2010 and created another profile of the same mailbox.

    I have taken snapshots after the whole process, i.e., after uninstalling standalone version of MAPI, and installing Microsoft Outlook 2010.

    The first snapshot is of the profile created using standalone version of MAPI and second snapshot is of the profile created using Outlook. So, I think there must be some problem in the profile created using standalone version of MAPI. Anyways, thanks for your help.


    • Edited by talib2608 Monday, June 9, 2014 8:18 AM
    Monday, June 9, 2014 8:10 AM
  • I am not sure what the problem is. Can you be more specific?


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

    Monday, June 9, 2014 1:18 PM
  • Hi Dmitry,

    I couldn't understand the answer in your previous comment but lets consider this thread solved. Thanks for your help.

    Thanks & regards,

    Talib Hussian

    Monday, June 9, 2014 1:47 PM