MAPI Windows 7 64 bit

I have an outdated application that creates an email message with an attachment. The code uses the MAPI interface to create the message. This code worked for quite some time.

When the application runs on a 64-bit Windows 7 machine, the MAPILogon call terminates with a common error code.

Is there any incompatibility with MAPI and Win7 64? Or are there some problems with COM that I don't know about?

+4
source share
4 answers

It seems that the problem depends on which API calls you are using.

Calls to MAPISendMail should work without problems.

For all other calls to the MAPI method and functions for working in the MAPI application, the bit (32 or 64) of the MAPI application should be the same as the bit system of the MAPI subsystem on the computer that the application is targeting.

In general, a 32-bit MAPI application should not run on a 64-bit platform (64-bit Outlook on 64-bit Windows) without being rebuilt as a 64-bit application.

For a more detailed description, see the MSDN page on Creating MAPI Applications on 32-bit and 64-bit Platforms

+7
source

I experienced something similar with an outdated application using Crystal Reports 8.5. The CR report viewer has an Export button that brings up a dialog that allows you to select Destination, one of which is Microsoft Mail (MAPI). Export to MAPI failed on Windows 7.

Obviously, the problem was that Microsoft refused to support "Simple MAPI" in Windows 7.

We were able to solve the problem with this hotfix from Microsoft: http://support.microsoft.com/kb/980681

Here is another discussion that may be useful for those who have a similar problem:

+1
source

try it

@echo off REM NOTE: The MAPI32.dll must be included in the same directory as this patchfile!! REM NOTE: change the username to corresponding if you're not on a domain remove @domain takeown /fc:\windows\system32\mapi32.dll cacls c:\windows\system32\mapi32.dll /G administrator@domain :F ren c:\windows\system32\mapi32.dll c:\windows\system32\mapi32.dll.ORIGINAL copy mapi32.dll c:\windows\system32\mapi32.dll if NOT '%PROCESSOR_ARCHITECTURE%'=='AMD64' goto END takeown /fc:\windows\sysWOW64\mapi32.dll cacls c:\windows\sysWOW64\mapi32.dll /G administrator@domain :F ren c:\windows\sysWOW64\mapi32.dll c:\windows\sysWOW64\mapi32.dll.ORIGINAL copy mapi32.dll c:\windows\sysWOW64\mapi32.dll :END 
+1
source

not defined specifically for MAPI, but maybe if done in .NET

-2
source

Source: https://habr.com/ru/post/1303161/


All Articles