当调用 Marshal.GetActiveObject(此处为 class id)时,什么会导致错误 800401E3(操作不可用)?

发布于 2024-07-26 00:31:10 字数 310 浏览 2 评论 0原文

我们遇到这样的情况:某些 .NET 代码尝试访问 COM(实际上是 DCOM)对象的当前实例。

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

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

当在托管该 DCOM 组件的计算机上运行时,相同的 .NET 代码似乎可以正确运行。

任何人都可以建议为什么会生成此 COMException 吗?

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

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.

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

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

Can anyone suggest why this COMException is getting generated?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北恋 2024-08-02 00:31:10

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文