A 64-bit copy of Outlook is installed, and a 32-bit program is trying to call MAPIInitialize(). It will fail, which is OK, but it will also display a modal message box and block until the message box is dismissed.

How can I prevent the very unhelpful message box from appearing?
(In case it matters, I'm linking to mapi32.lib and calling it from a C++ program. The OS is Windows 7.)
Your code ends up calling a stub 32 bit dll. Are you statically linking to mapi32.dll? You need to load the right dll from the Program Files folder. LoadLibrary() will return 0 and GetLastError will be ERROR_BAD_EXE_FORMAT if the bitness of the dll does not match the bitness of your process.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With