在 64 位 Windows 机器上使用 32 位 com 运行 32 位应用程序 [英] Running 32 bit app using 32 bit com on a 64 bit Windows machine

查看:49
本文介绍了在 64 位 Windows 机器上使用 32 位 com 运行 32 位应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 C++ COM 对象的 C# 应用程序,它们都构建在 32 位机器上.现在我必须在 64 位机器上运行它们.我注册了 COM 对象.在计算机hkey_classes_rootwow6432nodeclsid{xxx} 下的寄存器中创建了相应的条目.但是,当我尝试运行该应用程序时,它说 |由于以下错误,检索具有 CLSID {xxx} 的组件的 COM 类工厂失败:80040154.".据我了解,错误代码意味着该类未注册.请帮忙!!!谢谢

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 computerhkey_classes_rootwow6432nodeclsid{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

推荐答案

上面的第一个答案是正确答案.如果引用 32 位 COM 组件,则无法在 64 位 Windows 上运行 CPU ANY 目标应用程序.它不会加载.

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 ANY 并将您的应用程序提升到 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 位运行时(不存在).您必须仅将您的应用程序标记为 32 位才能使用 Access 运行时.

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% 托管代码.

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.

这篇关于在 64 位 Windows 机器上使用 32 位 com 运行 32 位应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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