Outlook 2007 - Missing MAPI API?

Add-in Express™ Support Service
That's what is more important than anything else

Outlook 2007 - Missing MAPI API?
 
Esteban Astudillo


Guest


Hi,

I'm still investigating this and will post my findings, but I wanted to check here if somebody has experienced something like this before.

I developed a COM add-in for Outlook using VS2005, ADX 3.2, and the Office 2003 PIAs. This is the newest version of my add-in with the previous one being different only in that it uses ADX 2.8 (and changes in my code, of course)

Yesterday I released this new version and people using Outlook 2007 cannot longer use my add-in. It fails in multiple places, but always related to calls to Extended MAPI like in the code below:


Outlook._NameSpace oNS = null;
Outlook.MAPIFolder oSentFolder = null;
try
 {
  oNS = _adxModule.outlookApp.GetNamespace("MAPI");
  oSentFolder = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderSentMail);
  _sSentItemsFullFolderName = MapiHelper.GetFullFolderName(oSentFolder);
  _sSentItemsFullFolderName = @"\" + _sSentItemsFullFolderName.ToLower();
 }
finally {
 if (oNS != null) 
  Marshal.ReleaseComObject(oNS);
 if(oSentFolder != null)
  Marshal.ReleaseComObject(oSentFolder);
}


As I said this was working fine with the previous version of my add-in using ADX2.8. I don't have control over what my users install or not in their computers but in one of the test machines I have with Outlook 2007 there were no other changes, not even Microsoft security updates (I'm paranoid with these now ;) )

The error I get is like this (in this specific case, the event handler to detect when a mail item is selected in the Explorer window):

Exception of type 'System.AccessViolationException' at 'DoSelectionChange'
 >> Module: Interop.Outlook (Interop.Outlook.DLL)
 >> Source: Interop.Outlook._NameSpace->GetDefaultFolder
 >> Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
 >> Stack:
 at Interop.Outlook._NameSpace.GetDefaultFolder(OlDefaultFolders FolderType)
 at CController.get_deletedItemsFullFoldername()
 at AddinModule.DoSelectionChange(_Explorer oExplorer, Boolean bSwitchViewMode, Boolean bForceRefresh)


After this the add-in doesn't really work.

Another issue I'm having and so far I can only guess is caused by the same problem, although I haven't seen evidence of this in my logs, is that the Inspector Toolbars are no longer visible in Outlook 2007 after I upgraded to ADX 3.2. They used to be visible under the Add-ins tabs in the Outlook 2007 Inspector windows.

I'm planing in the future to take advantage of ADX 3.2's support of Ribbons UI and all that, but in the meantime, even though the Inspector Toolbars were hidden in this tab, they were still visible providing a reasonable option to my current users using Outlook 2007. With these latest changes they are all out of luck with my product.

Any ideas?
Posted 02 Feb, 2007 12:26:07 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Esteban.

1. The problem can be in the GetFullFolderName function. Please try to debug it in the Visual Studio debugger.
2. You just need to set the UseForRibbon property to true.



P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.

Posted 04 Feb, 2007 18:41:10 Top
Esteban Astudillo


Guest


Hi Sergey,

Both of your comments were right on the money. I no longer have this issue.


Thanks

Esteban
Posted 05 Feb, 2007 13:37:56 Top