32-bit MAPI app with 64-bit Outlook

chrisd picture chrisd · Oct 9, 2012 · Viewed 15.7k times · Source

The 32-bit version of our app is unable to send email using MAPISendMail with 64-bit Outlook installed. It returns an error 0x80004005, about which I can find little information beyond the fact that it seems to be a MAPI initialization error.

According to this MSDN document, MAPISendMail is the one exception to the rule that 32-bit apps can't use 64-bit MAPI. And yet it doesn't work (at least with XP and Vista--we haven't tested Win7/8 yet).

Can anyone shed any light on this?

TIA

Answer

Dmitry Streblechenko picture Dmitry Streblechenko · Oct 9, 2012

There are no exceptions: a 32 bit process cannot load a 64 bit dll. When you have the 64 bit version of Outlook, the 64 bit version of mapi32.dll contains the actual implementation. The 32 bit version of mapi32.dll is a stub that does nothing but return an error.