• Sign In
 
  • MSDN Blogs
  • Microsoft Blog Images
  • More ...

  • Advanced search options...
  • About
  • Email Blog Author
  • RSS for posts
  • Atom
  • RSS for comments
    • OK
  • CDO (20)
  • Code Snippet (42)
  • Custom Providers (15)
  • Debugging (7)
  • DevMsgTeam (278)
  • Documentation (101)
  • DST (8)
  • EWS (7)
  • Exchange (100)
  • Gotchas (91)
  • Hotfix (28)
  • MAPI (220)
  • MAPI Download (48)
  • MFCMAPI (92)
  • MSDN (54)
  • Non Dev (11)
  • OOM (17)
  • Outlook (163)
  • Outlook 2007 Auxiliary Reference (45)
  • Outlook Integration API (11)
  • Protocol Docs (20)
  • PST/OST (22)
  • Referrals (8)
  • Vista (12)
  • WrapPST (15)
Links:
  • Download MFCMAPI
  • MFCMAPI on Facebook
  • Troubleshooting Outlook Crashes
  • Office Update Center
  • Developer Messaging Team Blog
This site is provided "AS IS" with no warranties, and confers no rights. Use of included code samples are subject to the terms specified in the Terms of Use.
Archives
  • May 2012 (1)
  • April 2012 (3)
  • March 2012 (3)
  • February 2012 (3)
  • January 2012 (1)
  • December 2011 (3)
  • November 2011 (1)
  • October 2011 (3)
  • September 2011 (1)
  • August 2011 (1)
  • July 2011 (4)
  • June 2011 (3)
  • May 2011 (3)
  • April 2011 (3)
  • March 2011 (5)
  • February 2011 (1)
  • January 2011 (2)
  • December 2010 (1)
  • November 2010 (4)
  • October 2010 (1)
  • September 2010 (3)
  • August 2010 (5)
  • July 2010 (3)
  • June 2010 (3)
  • May 2010 (1)
  • April 2010 (3)
  • March 2010 (3)
  • February 2010 (3)
  • January 2010 (2)
  • December 2009 (3)
  • November 2009 (5)
  • October 2009 (4)
  • September 2009 (5)
  • August 2009 (5)
  • July 2009 (11)
  • June 2009 (6)
  • May 2009 (5)
  • April 2009 (3)
  • March 2009 (18)
  • February 2009 (10)
  • January 2009 (3)
  • December 2008 (2)
  • November 2008 (2)
  • October 2008 (5)
  • September 2008 (4)
  • August 2008 (10)
  • July 2008 (6)
  • June 2008 (8)
  • May 2008 (2)
  • April 2008 (4)
  • March 2008 (2)
  • February 2008 (2)
  • January 2008 (5)
  • December 2007 (3)
  • November 2007 (2)
  • October 2007 (3)
  • September 2007 (1)
  • August 2007 (4)
  • July 2007 (5)
  • June 2007 (3)
  • May 2007 (4)
  • April 2007 (1)
  • March 2007 (6)
  • February 2007 (3)
  • January 2007 (2)
  • December 2006 (4)
  • November 2006 (3)
  • October 2006 (1)
  • August 2006 (1)
  • June 2006 (5)
  • May 2006 (5)
  • December 2005 (1)
  • November 2005 (4)
  • October 2005 (2)
  • September 2005 (1)
  • April 2005 (3)
  • December 2004 (2)
  • September 2004 (2)
  • August 2004 (3)
  • July 2004 (3)
Blogs I Read
  • Exchange

  • Raymond Chen [MSFT]

  • Larry Osterman [MSFT]

  • Peter David

  • Aaron Margosis [MSFT]

  • Jason Johnston [MSFT]

  • Matt Stehle (MSFT)

  • Patrick Creehan [MSFT]

  • Ryan Gregg [MSFT]

    Outlook PM
  • WebDav 101

    Dan Bagley (MSFT)
  • Dave Vespa [MSFT]

  • Randy Topken

    Outlook EE

November, 2009

MSDN Blogs > SGriffin's MAPI Internals > November, 2009
  • Subscribe via RSS
Sort by: Most Recent | Most Views | Most Comments
Excerpt View | Full Post View
  • SGriffin's MAPI Internals

    Outlook 2010 And Bitness

    Posted over 3 years ago
    by Stephen Griffin - MSFT
    • 3 Comments

    Angela’s put together a good set of guidelines for developing for Outlook 2010, particularly as it relates to whether your code is built for 32 bit or 64 bit (what we’re calling Bitness). To summarize, all MAPI or Outlook Object Model based apps and non-managed add-ins will need to be built in both 32 and 64 bit flavors to support both target environments, managed add-ins can be built as Any CPU, and VB 6 based add-ins and apps need to be scrapped and rewritten entirely. Read the full article to get the finer points, along with a good collection of links to more resources.

    Enjoy!

  • SGriffin's MAPI Internals

    November 2009 Release of MFCMAPI

    Posted over 3 years ago
    by Stephen Griffin - MSFT
    • 6 Comments

    The November 2009 Release (build 6.0.0.1016) is live: http://mfcmapi.codeplex.com.

    The September 2009 release was downloaded over 18 thousand times, with nearly 1700 of them being the 64 bit build. This exceeded the July build by about 4000 downloads. Yay MFCMAPI!

    Mostly bug fixes this time around. Win 7 finally made me dig into why Close All Windows wasn’t working, and I did a bit of work to make MFCMAPI a better multimon client.

    Here's a change list - see the Issue Tracker on Codeplex for more details, or look at the code:

    • Close All: Shutdown of contents table windows was swallowing the WM_CLOSE message for the other windows. Whoops!
    • Multimon: New windows and context menus now show on the same screen as their parent window, as they should.
    • Unicode Files: MFCMAPI can now handle files (like .msg or .eml files) that have Unicode characters in their names.
    • Property Editor: It’s now possible to manually insert CR/LF characters directly in the hex stream of a property and write the exact data you intended, as long as you don’t touch the text editor. This is to work around a bug/feature of the rich edit control that made reproducing certain issues impossible.
    • Smart View: Can now turn Smart View off if you’ve got a property that’s causing it to choke. Do continue to report these to me though!
    • Version selection: Did some work to make it clearer when you’re running the wrong version of MFCMAPI (32/64) for the version of MAPI you have.
    • Error Dialog Suppression: Identified a number of “error” dialogs that confused more than they helped and eliminated them. If there was an actual error it’s written to the debug output.
    • Tons of minor issues – 22 total bugs tied to this release, and those are just the ones that were worth calling out.

    Enjoy.

  • SGriffin's MAPI Internals

    Where CDO Publishes Free Busy Information

    Posted over 3 years ago
    by Stephen Griffin - MSFT
    • 0 Comments

    From time to time, I get asked to explain where CDO publishes Free Busy information in the Public Folder store, so I figured I’d put this article together. The basic process CDO uses for updating FB information is outlined in the More Information section of KB 278954. We’re concerned with the part of the process summarized as “queued up to be sent to the site’s Free/Busy public folder.”

    The first thing CDO does is to open the Public Folder store and read a couple properties off of it, PR_FREE_BUSY_FOR_LOCAL_SITE_ENTRYID (0x66250102) and  PR_SPLUS_FREE_BUSY_ENTRYID (0x66220102). These entry IDs will point at a couple folders in the Public Folder store. The first entry ID points the Free Busy folder for the user’s site, the folder CDO wants to look in for the Free Busy message. If CDO cannot open the folder specified by PR_FREE_BUSY_FOR_LOCAL_SITE_ENTRYID, it turns to the second property, PR_SPLUS_FREE_BUSY_ENTRYID, which points at the “SCHEDULE+ FREE BUSY” folder, a child folder of the NON_IPM_SUBTREE folder. This property will point at the same folder for all users. In this case, CDO will use an algorithm similar to the one described in [MS-OXOPFFB] to find the correct site folder for the Free Busy message.

    The point of failure here is the Entry ID specified in PR_FREE_BUSY_FOR_LOCAL_SITE_ENTRYID. If this points at the wrong folder, CDO will publish Free Busy information to the wrong folder, and other clients won’t see the updated Free Busy. This property is not one that anybody sets. It’s actually computed on the server side. No amount of changes to a CDO based program can get it to publish Free Busy to the correct folder if the server is handing out the wrong site folder.

    This is where server side troubleshooing articles such as KB 326637 and Exchange Public Folder Troubleshooting Resources come in handy. They walk you through the various things that could be wrong with site folders and how to fix them. If PR_FREE_BUSY_FOR_LOCAL_SITE_ENTRYID is pointing at the wrong folder for your users you’ll need to use the steps in those articles to locate the problem and fix it.

    Suppose you just want to determine if PR_FREE_BUSY_FOR_LOCAL_SITE_ENTRYID is pointing at the folder you’d expect it to point to for a particular user. You can use MFCMAPI to see where this entry ID points to.

    First, we check which folders we’re being pointed at:

    1. Open MFCMAPI on the machine where your CDO application runs.
    2. Log on to a profile. You’ll get your best results if you can use the same profile the CDO application uses.
    3. Select the Public Folder store in the list of stores.
    4. The properties we want may or may not show in the default list of properties, so we’ll add them:
      1. Click Property Pane/Modify Extra Properties
      2. Click Add
      3. In the Property Tag field, type in PR_FREE_BUSY_FOR_LOCAL_SITE_ENTRYID. The rest of the form should fill out automatically.
      4. Click OK, then click Add again.
      5. In the Property Tag field, type in PR_SPLUS_FREE_BUSY_ENTRYID. The rest of the form should fill out automatically.
      6. Click OK, then click OK again to close the Extra Properties window.
    5. We’ve added the properties, so they should show in the property pane. You can sort by the Property Name column and look them up by name, or sort by the Tag column and look them up by number (0x66250102 for PR_FREE_BUSY_FOR_LOCAL_SITE_ENTRYID and 0x66220102 for PR_SPLUS_FREE_BUSY_ENTRYID.
    6. Right click on PR_FREE_BUSY_FOR_LOCAL_SITE_ENTRYID and select Open as Entry ID or Object. In the dialog that comes up, hit OK.
    7. In the resulting hierarchy view, you can now read the name of the site folder the server has directed you to.
    8. Switch back to the main window and reselect the Public Folder store to refresh the property list.
    9. Right click on PR_SPLUS_FREE_BUSY_ENTRYID and select Open as Entry ID or Object. In the dialog that comes up, hit OK.
    10. This will display the hierarchy for the SCHEDULE+ FREE BUSY folder. Click the + icon to display the list of all the site folders in the Public Folder store.

    Next, we determine which folders we should be looking at, following the algorithm from [MS-OXOPFFB]:

    1. In the main window of MFCMAPI, select Session/Display Current User Properties. Hit OK.
    2. In the Property Pane, locate PR_SEARCH_KEY (0x300B0102).
    3. Double-click on the property to open it, and take note of the Text field. For me, this says “EX:/O=MICROSOFT/OU=NORTHAMERICA/CN=RECIPIENTS/CN=420275”
    4. The appropriate site folder can be derived by truncating this string at the / before the first CN. So for me, my site folder should be “EX:/O=MICROSOFT/OU=NORTHAMERICA”.

    So, now you know what site folder the user has listed in PR_FREE_BUSY_FOR_LOCAL_SITE_ENTRYID, and you know the name of the site folder they should be using. If these two are not the same folder, then you have site folder issues and need to get them addressed.

    Hopefully, this should be enough to help folks who are having site folder issues to understand that CDO is just the innocent victim here when it publishes Free Busy to the wrong folder, and that server side configuration is the real villain.

    Enjoy!

  • SGriffin's MAPI Internals

    Strange Looking NDR

    Posted over 3 years ago
    by Stephen Griffin - MSFT
    • 2 Comments

    Not many people are aware of the feature, but MFCMAPI implements a MAPI Form Viewer. This means MFCMAPI can use MAPI to ask Outlook to display messages. You might have run into this if you ever double-click on a message in MFCMAPI. If you’re on a machine with Outlook installed, the message will open up like it does when you double-click it in Outlook. And if Outlook isn’t installed and you’re using Exchange’s MAPI, you get a scary dialog saying we couldn’t open the MAPI form manager.

    This is one of those dark corners of MAPI into which few people tread, and most of those who do end up cribbing or parroting the Form Viewer implementation in MFCMAPI itself, meaning nearly every issue they report related to form viewers can be reproduced in MFCMAPI. Sometimes, this turns out to be a bug in my implementation, like an errant warning while clicking up and down through messages (fix coming very soon!). Other times, the problem is a bug in Outlook.

    My latest customer’s issue turned out to be the latter case. They had noticed that when they tried to view NDR messages with their Form Viewer, the body of the message would be full of alien looking RTF text:

    “{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fmodern\fcharset0 Consolas;}}
    {\*\generator Riched20 12.0.6413.1000;}\viewkind4\uc1
    \pard\fi-1440\li1440\tx1440\f0\fs21 Your message did not reach some or all of the intended recipients.\par
    etc…”

    What was really odd was that if you looked at the message in MFCMAPI, this text was no where to be found! And to top it off – if you opened the message from Outlook, you got the NDR message you expected.

    So what was going on? It’s not surprising that Outlook builds the NDR text on the fly. It’s much easier to localize it that way. And the RTF does appear to be the underlying RTF we would generate for the NDR message. But why did we display it wrong, and why did Outlook display it right?

    The key here is the LoadForm function. This function takes the message class of the form we want to load. Under the covers, LoadForm looks up the message class using ResolveMessageClass and gets the GUID for the associated class factory. The form manager then passes this GUID over to Outlook and asks for the class factory. This is where we have a problem. Outlook uses the same GUID for multiple form class factories, some of which have different attributes associated with them. The class factory we get has an attribute on it stating it should render using HTML, while the class factory we should have gotten did not have this attribute. So when it comes time to render the text, we use the wrong rendering method and get the ugly RTF text.

    When Outlook opens the message, being the implementer of the forms, it gets to skip many of the MAPI steps. Instead of using the message class to look up a GUID, it uses the message class to look up the class factory directly, getting the right one in the process.

    Based on the fact that this behavior has been unchanged for as long as we can trace back, and we’re only just now hearing of an issue with it, we chose not to fix this problem, but instead document it. So – here’s the documentation. Enjoy!

  • SGriffin's MAPI Internals

    Announcing EWSEditor 1.5!

    Posted over 3 years ago
    by Stephen Griffin - MSFT
    • 0 Comments

    Matt’s very excited about the release of EWSEditor. This tool does for EWS what MFCMAPI does for MAPI. With this tool, Matt does what I did with MFCMAPI and what I recommend to anyone trying to learn a new API: the best way to learn an API is to write tools that use it.

    As you work with EWSEditor, you may notice a few things which are similar to MFCMAPI. This is no coincidence. EWS and MAPI, both designed primarily to interact with an Exchange server, share much of the same object hierarchy, which in turn dictates that tools designed to explore these hierarchies will be similar. Also, since we sit near each other and act as each other’s ad-hoc PMs, we borrow each other’s features. For instance, EWSEditor implements much of the same Smart View parsing as MFCMAPI, using the same logic, recoded from C++ to CSharp.

    Of course, there’s one similarity between EWSEditor and MFCMAPI that has nothing to do with the underlying APIs or fancy features and everything to do with the fact that Matt and I are programmers, not icon designers. Look familiar?

    EWSEditor

    Enjoy!

Page 1 of 1 (5 items)
  • © 2012 Microsoft Corporation.
  • Terms of Use
  • Trademarks
  • Privacy Statement
  • Report Abuse
  • 5.6.402.223