C# MAPI32.dll返回消息';失败的API';在windows10c中#

C# MAPI32.dll返回消息';失败的API';在windows10c中#,c#,outlook,dllimport,mapi,C#,Outlook,Dllimport,Mapi,我正在使用以下代码段 [DllImport("MAPI32.DLL")] public static extern int MAPISendMail(IntPtr session, IntPtr hwnd, MapiMessage message, int flg, int rsv); 升级到Windows 10后,“我的软件”会显示以下消息: 日志类中的“失败API”是代码2 我还没有找到解决方案,但是当我终止Outlook进程时, 错误不会发生。有人也有同样的问题吗?如何解决它?那么函数返

我正在使用以下代码段

[DllImport("MAPI32.DLL")]
public static extern int MAPISendMail(IntPtr session, IntPtr hwnd, MapiMessage message, int flg, int rsv);
升级到Windows 10后,“我的软件”会显示以下消息:

日志类中的“失败API”是代码2

我还没有找到解决方案,但是当我终止Outlook进程时,
错误不会发生。有人也有同样的问题吗?如何解决它?

那么函数返回什么?可能是权限问题。尝试以相同的权限级别运行应用程序和outlook。返回代码2 Alex K.Johnny,我意识到这一点。。。