简体   繁体   English

MAPIInitialize没有错误消息框

[英]MAPIInitialize without error message boxes

A 64-bit copy of Outlook is installed, and a 32-bit program is trying to call MAPIInitialize(). 安装了64位的Outlook副本,并且32位程序正在尝试调用MAPIInitialize()。 It will fail, which is OK, but it will also display a modal message box and block until the message box is dismissed. 它会失败,这没关系,但它也会显示一个模态消息框并阻塞,直到消息框被解除。

MAPIInitialize错误消息

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.) (如果重要,我将链接到mapi32.lib并从C ++程序调用它。操作系统是Windows 7.)

Your code ends up calling a stub 32 bit dll. 您的代码最终调用存根32位dll。 Are you statically linking to mapi32.dll? 你是静态链接到mapi32.dll吗? You need to load the right dll from the Program Files folder. 您需要从Program Files文件夹中加载正确的dll。 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. 如果dll的位数与进程的位数不匹配,LoadLibrary()将返回0并且GetLastError将为ERROR_BAD_EXE_FORMAT。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM