运行使用32位COM一个64位的Windows机器上的32位应用程序应用程序、机器上、COM、Windows

2023-09-04 02:57:47 作者:呵呵男人

我在使用C ++ COM对象既要建设一个32位机器上的一个C#应用程序。现在我有一个64位计算机上运行它们。我注册的COM对象。相应的项目被下电脑\ HKEY_CLASSES_ROOT \ wow6432node \ CLSID {}​​ XXX寄存器产生。 然而,当我尝试运行应用程序它说|检索COM类工厂具有CLSID {}​​ XXX组件由于以下错误而失败:80040154。据我了解,错误code意味着该类未注册。 请帮忙!!! 谢谢

I have a C# application using C++ COM object both build on a 32 bit machine. Now I have to run them on a 64 bit machine. I registered the COM object. A corresponding entry was created in the register under computer\hkey_classes_root\wow6432node\clsid{xxx}. However, when I try to run the application it says that |"Retrieving the COM class factory for component with CLSID {xxx} failed due to the following error: 80040154.". As I understand, the error code means that the class is not registered. Please, help!!! Thanks

推荐答案

第一个答案上面是正确的答案。您不能运行在CPU上的64位Windows的任何目标应用程序,如果你引用一个32位的COM组件。它不会加载。

The first answer above is the correct answer. You cannot run a CPU ANY target application on 64 bit Windows if you reference a 32 bit COM component. It will not load.

正在发生的事情是,JIT是看到任何CPU和促进你的应用程序到64位。但是没有64位版本的COM控件的,因此你得到的未注册的错误。

What is happening is that the JIT is seeing CPU ANY and promoting your App to 64 bit. But there is no 64 bit version of the com control and hence you get the not registered error.

这是谁使用Microsoft Access为他们的数据库的人一个很大的问题。有没有64位版本的Access,所以当他们看到,他们认为他们需要一个64位运行时错误(不存在)。你必须标志只是为了使用Access运行你的应用程序为32位。

This is a big problem for people who use Microsoft Access for their database. There is no 64 bit version of Access, so when they see the error they think they need a 64 bit runtime (doesn't exist). You have to flag your app as 32 bit only in order to use the Access runtime.

这是一个糟糕的选择(恕我直言) - 找到一个更好的组件,有一个64位版本,或者去100%托管code

This is a poor choice (IMHO) - find a better component that has a 64 bit version, or go 100% managed code.

我不喜欢每一个标签的应用程序为32位,除非他们真的需要它。

I don't like to every tag apps as 32 bit only unless they REALLY need it.