调用 Marshal.GetActiveObject(此处为 class id)时,什么会导致错误 800401E3(操作不可用)? [英] When calling Marshal.GetActiveObject( class id here) what would cause error 800401E3 (Operation Unavailable)?

查看:33
本文介绍了调用 Marshal.GetActiveObject(此处为 class id)时,什么会导致错误 800401E3(操作不可用)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个场景,其中一些 .NET 代码试图访问 COM(实际上是 DCOM)对象的当前实例.

We have a scenario where some .NET code is attempting to access the current instance of a COM (actually DCOM) object.

被访问的对象是在 VB6 中开发的.它的当前实例在远程系统上可用,并且似乎可以从 VB6 代码正确访问.

The object being accessed was developed in VB6. A current instance of it is available on the remote system, and appears to be accessed correctly from VB6 code.

尝试调用 Marshal.GetActiveObject,指定类名,导致抛出 COMException,引用错误 800401E3(操作不可用).

Attempting to call Marshal.GetActiveObject, specifying the class name, causes a COMException to be thrown, referencing error 800401E3 (Operation Unavailable).

在托管该 DCOM 组件的机器上运行时,相同的 .NET 代码似乎可以正常运行.

The same .NET code appears to operate correctly when run on the machine hosting that DCOM component.

谁能建议为什么会生成这个 COMException?

Can anyone suggest why this COMException is getting generated?

推荐答案

您是否尝试在 dot net 客户端应用程序中使用 [STAThread] 属性?

Did you try to use the [STAThread] attribute in the dot net client app?

这篇关于调用 Marshal.GetActiveObject(此处为 class id)时,什么会导致错误 800401E3(操作不可用)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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