Up until today, the first rule of 64 bit MAPI was we don’t talk about 64 bit MAPI. But now we can talk about it. 64 bit MAPI has arrived!
We just released the Outlook 2010 MAPI Reference today. If you develop MAPI based applications, you’ll want to get the updated MAPI Headers that come with it. You’ll need these if you want to rebuild your application for 64 bit. We’ve also prepared an article on building MAPI applications for both 32 bit and 64 bit platforms. This article is based in part on my experience building MFCMAPI as a 64 bit application. Since we don’t provide a 64 bit mapi32.lib, to build a 64 bit MAPI application you’re going to have to use explicit linking, building on the documentation we included in the Outlook 2007 MAPI reference.
Oh yeah – that reminds me – MFCMAPI builds as a 64 bit application! Actually, it’s been possible to build MFCMAPI as 64 bit for years. I slipped those project types in a long time ago and have been quietly maintaining them, even before I had an actual 64 bit build of MAPI I could test against. The next release of MFCMAPI will include a 64 bit build of the project, but if you want a 64 build now, just download the source and build it yourself.
My code predates (and in some cases, informs) those new headers. Lemme know if you find something not working in 64 bit that would be fixed by adding _WIN64.
The only thing I see that would break would be if someone hits #defines below. You are not using them now... but mostly I was wondering about the best practices...
#if defined (_WIN64) && defined (_AMD64_)
#define szScCreateConversationIndex "ScCreateConversationIndex"
#elif defined (_WIN32) && defined (_X86_)
#define szScCreateConversationIndex "_ScCreateConversationIndex@16"
#error "Unknown Platform: MAPI is currently supported on Win32/X86 and Win64/AMD64"
#if defined (_WIN64) && defined(_AMD64_)
#define szHrDispatchNotifications "HrDispatchNotifications"
#define szHrDispatchNotifications "_HrDispatchNotifications@4"
I just took a look at the project and _WIN64 does get defined for a 64 bit build. Check out the string for IDS_EDMAPIINITIALIZEFAILED which flips based on it.
_WIN64 is defined in MFCMAPI under Resource pre-processor( Properties->resources tab->preprocessor definitions). It's not defined under C++ pre-processor definitions ( so it would not be pulled into the code, I believe ). In any case, your first reply pretty much answered my question.