COM 类工厂错误
当我尝试使用 COM 对象时,我的工作站上出现以下错误。
未处理的类型异常 'System.Runtime.InteropServices.COMException' 发生在CarteGraphInterface.exe
附加信息:检索 组件的 COM 类工厂 CLSID {3963F0F8-6B0C-4A65-90F4-F60168044014} 由于以下错误而失败: 80040154。
我已阅读一些这里有关于SO的问题,但没有一个有帮助。该 ID 未在注册表中的任何位置列出。需要添加吗?
更新:更多信息。当我在 VS2008 中选择“添加引用...”时,该对象会在那里列出(这就是我最初找到它的方式),源代码会列为 *.exe。 regsrv32 不起作用。
I am getting the following error on my workstation when I am trying to work with a COM object.
An unhandled exception of type
'System.Runtime.InteropServices.COMException'
occurred in CarteGraphInterface.exeAdditional information: Retrieving the
COM class factory for component with
CLSID
{3963F0F8-6B0C-4A65-90F4-F60168044014}
failed due to the following error:
80040154.
I have read through a few questions here on SO and non of them have helped. That ID is not listed anywhere in the registry. Does it need to be added?
Update: A bit more information. When I choose "Add Reference..." in VS2008, the object is listed there (that is how I found it initially), and the source is listed as a *.exe. regsrv32 didn't work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可能需要
先使用“尝试”来注册 COM DLL,然后看看这是否会产生影响。
编辑:不知道您是否使用此功能,但 COM Explorer 也可能对您有所帮助。尝试试用版本是否可以帮助您解决此问题。
编辑:我一直在尝试查找有关错误代码的更多信息,我能找到的最好的是 this ,这表明它一定是未注册的DLL。
It might be that you need to register the COM DLL using
Try that first perhaps and see if that makes a difference.
EDIT: Don't know if you use this, but COM Explorer might be able to help you too. Try the trial version to if it helps you with this problem.
EDIT: I've been trying to find out more about the error code, and the best I could find is this, which clarifies that it must be the DLL which is not registered.
您是如何添加对您的项目的引用的?使用 COM 时,您几乎总是应该在“COM”选项卡(而不是“浏览”)添加引用,这可确保您获得对已注册对象的有效引用,从而创建新的互操作程序集。不过,如果您遇到注册问题,您很可能在 COM 选项卡上找不到所需的参考。
首先,COM 组件存在于可执行文件中是非常奇怪的(尽管这是可能的)。也许这个组件不应该从另一个应用程序实例化,因此所有注册数据都已被删除?我建议您联系从您那里获得此组件的任何人,并索取可注册的 dll 版本。
How did you add reference to your project? When working with COM you almost always should add reference at "COM" tab (not at "Browse"), this ensures you will get a valid reference to a registered object, creating a new interop assembly. Though, if you have a registration problem, you most probably won't find required reference on COM tab.
First, it's very strange for a COM component to live in an executable file (though it's possible). Maybe this component wasn't supposed to be instantiated from another application, so all registration data had been removed? I would suggest contacting whomever you got this component from and ask for a registerable dll version.
这些解决方案都不起作用。我认为他们实际上没有可以与 .NET 一起使用的 API(如果有的话)。
None of these solutions worked. I assume that they do not actually have APIs that could be used with .NET (if at all).