在64位计算机上使用32位的DLL [英] Using a 32 bit dll on a 64 bit machine

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

问题描述

我有一个旧的项目,该项目采用的是32位的DLL。这工作正常,在32位处理器,但是当我安装在64位操作系统这是行不通的同一个项目。

I have an old project which uses a 32 bit dll. This works fine on 32 bit processor, however when I install the same project on a 64 bit OS it does not work.

有什么办法来转换32位DLL到64位?是否有其他解决方案,解决方案,使我的32位DLL工作在64位操作系统?

Is there any way to convert 32 bit dll to 64 bit? Is there an alternative solution solution to make my 32 bit dll work in a 64 bit OS?

推荐答案

您32位的dll应该只是罚款64位的机器上,只要它被加载到32位进程 - 试图加载32位DLL到一个64位的过程将失败。

Your 32 bit dll should work just fine on a 64 bit machine as long as it is loaded into a 32 bit process - attempting to load a 32 bit dll into a 64 bit process will fail.

如果你的项目是一个.NET(例如C#)应用程序,那么你应该能够针对您的大会86,为了让您的32位DLL工作correclty:

If your project is a .Net (e.g. C#) application then you should be able to target your assembly at x86 in order to get your 32 bit dll working correclty:

  • 右键单击在Visual Studio中的项目并选择属性
  • 在生成项目属性选项卡上确保该平台的目标下拉读取,而不是任何CPU
  • 中的x86

如果你的平台的目标是任何CPU,那么你的项目一般会在什么平台上可用,即64位在64位操作系统的目标 - 这将prevent您32位的dll被加载。

If you platform target is "Any CPU" then your project will normally be targeted at whatever platform is available, i.e. x64 on a 64 bit OS - this will prevent your 32 bit dll from being loaded.

如果你的项目是不是一个.NET程序集则相当于步骤需要做上面会有所不同。

If your project is not a .Net assembly then the equivalent steps needed to do the above will be different.

另外,您可以尝试获得一个64位版本的DLL的 - 如果它是你已经产生,那么你需要将它迁移到64位自己的DLL。如果没有,那么你是依赖于原始供应商提供了一个64位兼容的版本。

Alternatively you can attempt to obtain a 64 bit version of your dll - if it is a dll that you have produced then you will need to migrate it to 64 bit yourself. If not then you are dependent on the original suppliers providing a 64 bit compatible version.

这篇关于在64位计算机上使用32位的DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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