技术解决COM相关的0x80040154错误? [英] Techniques for resolving COM-related error 0x80040154?

查看:1796
本文介绍了技术解决COM相关的0x80040154错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新了更多的调试信息

我跑,我没有源代码的专有软件,它具有一个基于COM的一个插件接口。我有一个.NET程序集是COM可见,应用程序加载成功一台计算机上,而不是在另一个。

I'm running a proprietary software package that I don't have source for, and it has a plugin interface that is COM-based. I have a .NET assembly that is COM-visible that the application successfully loads on one computer, but not on another.

我一直对这个问题过去两天了,我觉得我漫无目的的游荡的COM景观。在系统不加载我的插件,当我使用 regasm / codeBase的/ TLB ,TLB中产生并成功注册。

I've been working for the past two days on this problem, and I feel like I am aimlessly wandering the COM landscape. On the system that doesn't load my plugin, when I use regasm /codebase /tlb, the tlb is generated and registered successfully.

当我看着提供给我的唯一的日志文件,它提到,它不能创建对象,并返回错误code 0x80040154的。

When I look at the only log file available to me, it mentions that it can't create the object, and returns the error code 0x80040154.

我不明白,为什么对象不能创建,和我希望有人能提出一些调试策略。以下是我已经尝试过,但没有成功:

I can't figure out why the object can't be created, and am hoping that someone can suggest some debugging strategies. Here is what I have already tried, without success:

  • 从工作计算机复制我的DLL和它的依赖到非正常工作的计算机
  • 非工作计算机上安装Visual Studio 2010(工作电脑有它安装)
  • 在比较两个计算机(它们是相同的)上的Dependency Walker的结果我的DLL和它的依赖
  • 使用listdlls的。这两个系统加载相同的DLL
  • 在RAN进程监视器和运行时过滤上的CLSID组件 regasm / codeBase的/ TLB 。这两种日志均一样的除了PID和日戳,即使工作系统创建TLB并成功注册,和非工作系统中注册的组件,但没有创造的TLB。
  • 在RAN进程监视器,并在运行应用程序过滤上的CLSID组件。该工作系统日志中有几个项目,但非工作系统什么都没有,我相信这是意料之中的,因为TLB中没有得到建立。
  • 在看着OLEVIEW的工作体系,具备了与它下面的类型库中列出的组件。非工作系统具有列出的组件,但没有一个准的类型库。见下文。
  • copy my DLL and its dependencies from the working computer to the non-working computer
  • installing VS2010 on the non-working computer (the working computer had it installed)
  • comparing the results of Dependency Walker for my DLL and its dependencies on both computers (they were identical)
  • used ListDLLs. Both systems load the same DLLs
  • ran Process Monitor and filtered on the CLSID for the assembly while running regasm /codebase /tlb. Both logs were identical except for the PIDs and datestamps, even though the working system create the tlb and registered successfully, and the non-working system registered the assembly, but didn't create the tlb.
  • ran Process Monitor and filtered on the CLSID for the assembly while running the application. The working system had several entries in the log, but the non-working system had none, which I believe is expected since the tlb didn't get created.
  • looked at OleView on working system, which had the assembly listed with the typelibrary beneath it. The non-working system had the assembly listed, but did not have an associate type library. See below.

下面是大会的条目之间的OLEVIEW在工作和非工作系统的区别:

Here are the the differences between the assembly's entry in OleView on the working and non-working systems:

  • 工作系统,我认为对应于生成和注册类型库的程序集下的条目。非工作系统没有。
  • 在_Object在非工作系统具有CLSID下,一个额外的值称为 InprocServer32的[InprocServer32的] =(废话这里)
  • 的IConnectionPointContainer在非工作系统具有相同的 InprocServer32的进入如上
  • 在相同的IDispatch接口,IManagedObject和IProvideClassInfo
  • Working system has an entry under the assembly that I assume corresponds to the typelibrary that was generated and registered. Non-working system does not.
  • _Object on non-working system has an extra value under CLSID called InprocServer32[InprocServer32] = (gibberish here).
  • IConnectionPointContainer on non-working system has the same InprocServer32 entry as above
  • same for IDispatch, IManagedObject, and IProvideClassInfo

我会看通过注册表,也许我需要删除这些额外的条目,并尝试再次运行regasm?

I'll look through the registry, and perhaps I need to remove those extra entries and try to run regasm again?

编辑 - 我解决了这个问题。谢谢大家对你的帮助。事实证明,一个文件丢失在两个系统上,但是由于各种原因,regasm在一个工作,而不是其他。我很怀疑,有可能是在那里的依赖被复制到是在系统路径的文件夹的变化!所以,我做了一个万福玛利亚,复制DLL,而且regasm没有任何消息执行。然后应用程序加载的插件成功!

EDIT -- I solved the problem. Thanks everyone for your help. It turns out that a file was missing on both systems, but for whatever reason, regasm worked on one, and not the other. I'm suspicious that there may have been a change where a dependency was copied to a folder that was in the system path! So I did a hail mary, copied over the dll, and regasm executed without any messages. And then the application loaded the plugin successfully!

推荐答案

我假设该组件产生的类未注册的错误是你的,对吗?换句话说,你确定从日志,它的努力的CoCreate你的对象?进行仔细的检查。

I'm assuming that the component generating the "class not registered" error is yours, right? In other words, are you sure from the log that it's trying to CoCreate your object? Just a sanity check.

您可能要尝试直接使用OLEView.exe这类工具创建的COM对象。它已经有一段时间,因为我用它,但我记得,你可以找到你的类,然后尝试直接实例吧。

You might want to try directly creating your COM object using a tool like Oleview.exe. It's been a while since I've used it but I remember that you can find your class, then try to instantiate it directly.

您还可能要火起来像将procmon(sysinternals.com)和捕捉哪些注册表被读取时发生错误时条目的工具。在RegOpenKey操作过滤器(操作RegOpenKey),寻找失败的结果(结果没有成功)。这是一个有点乏味,但通过比较2台机器之间的寄存器痕迹可能指向你的答案。

You also might want to fire up a tool like procmon (sysinternals.com) and capture what registry entries are being read at the time that the error occurs. Filter on RegOpenKey operations (Operation is RegOpenKey) and look for unsuccessful results (Result is not SUCCESS). It's a bit tedious but by comparing the reg traces between the 2 machines it might point you to the answer.

祝你好运!

约翰·

这篇关于技术解决COM相关的0x80040154错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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