2010-03-04 130 views
4

我有一個遺留應用程序,它創建一個帶有附件的電子郵件消息。該代碼使用MAPI界面創建消息。這段代碼已經運行了很長時間了。MAPI Windows 7 64位

當應用程序在Windows 7 64位計算機上運行時,對MAPILogon的調用將失敗並顯示一般錯誤代碼。

是否與MAPI和Win7 64不兼容?還是有一些我不知道的COM問題?

+1

我沒有在Win7的X64尚未測試過,我會嘗試,當我下班回家。但是,如果它對你有幫助,我在win7 32上完全沒有任何MAPI問題。 – 2010-03-04 20:55:19

+1

我對Win7 x64上的MAPI沒有任何問題。請注意,在設置Windows Mail或Windows Live Mail或任何其他郵件客戶端之前,沒有默認郵件客戶端和默認MAPI提供程序。 – wqw 2010-03-04 22:20:31

+0

@Quintin,你有沒有機會在Win 7 x64上測試MAPI? – epotter 2010-03-08 15:10:44

回答

7

它看起來像這個問題取決於哪個API調用你使用完成。

調用MAPISendMail應該沒有問題。

對於在MAPI應用程序中工作的所有其他MAPI方法和函數調用,MAPI應用程序的位數(32或64)必須與應用程序針對的計算機上的MAPI子系統的位數相同運行。

通常,如果不首先將其重建爲64位應用程序,則32位MAPI應用程序不得在64位平臺(64位Windows上的64位Outlook)上運行。

有關更詳細的explination,看到Building MAPI Applications on 32-Bit and 64-Bit Platforms

-2

沒有特別的問候MAPI肯定,但也可以是如果它在.NET

+0

你能否詳細說明「可以,如果它在.Net中完成」? – epotter 2010-03-08 15:09:45

+0

如果沒有編譯爲32位,我就遇到了.net的問題,它會自動使用64位,並且在使用32位COM組件 – 2010-03-08 21:56:30

1

我經歷過這樣的事情與使用Crystal Reports 8.5遺留應用程序的MSDN頁面。 CR報告查看器有一個「導出」按鈕,它會顯示一個對話框,讓您選擇「目的地」,其中之一是「Microsoft Mail(MAPI)」。導出到MAPI是在Windows 7

失敗顯然給Microsoft問題是由於在Windows放棄對「簡單MAPI」支持7

我們能夠與微軟此修復程序來解決問題: http://support.microsoft.com/kb/980681

這裏有可能對任何人有所幫助有類似的問題,其他一些討論:

1

試試這個

@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 /f c:\windows\system32\mapi32.dll 
cacls c:\windows\system32\mapi32.dll /G [email protected]: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 /f c:\windows\sysWOW64\mapi32.dll 
cacls c:\windows\sysWOW64\mapi32.dll /G [email protected]:F 
ren c:\windows\sysWOW64\mapi32.dll c:\windows\sysWOW64\mapi32.dll.ORIGINAL 
copy mapi32.dll c:\windows\sysWOW64\mapi32.dll 
:END