C#COM Office Automation - RPC_E_SYS_CALL_FAILED [英] C# COM Office Automation - RPC_E_SYS_CALL_FAILED

查看:1251
本文介绍了C#COM Office Automation - RPC_E_SYS_CALL_FAILED的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在写一个C#程序,作为PowerPoint 2007插件。在某些机器上,对PowerPoint对象模型的一些调用将使用消息RPC_E_SYS_CALL_FAILED来抛出COMException。我找不到任何具体的建议,如何做关于这个错误,或如何避免它。从Googling它看起来像与消息队列或单线程公寓有关。

I'm writing a C# program that acts as a PowerPoint 2007 plugin. On some machines, some calls to the PowerPoint object model throws a COMException with the message RPC_E_SYS_CALL_FAILED. I couldn't find any specific advice on what to do regarding this error, or how to avoid it. From Googling it looks like something to do with the message queue or Single-Threaded Apartments. Or am I way off?

错误消息的示例是:
系统调用失败。 (来自HRESULT的异常:0x80010100(RPC_E_SYS_CALL_FAILED))
at Microsoft.Office.Interop.PowerPoint._Presentation.get_FullName()

Example of the error message is: System call failed. (Exception from HRESULT: 0x80010100 (RPC_E_SYS_CALL_FAILED)) at Microsoft.Office.Interop.PowerPoint._Presentation.get_FullName()

不幸的是,一个客户端的机器,所以我没有简单的方法来调试它!每当我收到此错误,我应该重试呼叫吗?

Unfortunately, the problem is occurring on a client's machine, so I have no easy way to debug it! Should I just retry the calls whenever I get this error?

任何建议,以帮助我解决这个问题将非常感谢!

Any advice to help me resolve this problem would be greatly appreciated!

推荐答案

我不知道它是与你的问题有关,但是所有的COM调用必须来自创建加载项的同一个线程。如果你创建了新线程,你必须格外小心。详情在以下两篇文章中有描述:

I don't know it is related to your problem, but all your COM calls must come from within the same thread your add-in was created on. If you created new threads you must take special care. Details are described in these two articles:

  • Implementing IMessageFilter in an Office add-in and
  • Why your COMAddIn.Object should derive from StandardOleMarshalObject

这篇关于C#COM Office Automation - RPC_E_SYS_CALL_FAILED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆