调用从64位进程的32位code [英] Calling 32bit Code from 64bit Process

查看:286
本文介绍了调用从64位进程的32位code的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我们试图迁移从32位到64位的应用程序。这是.NET,用64标志编译。但是,我们有大量写在Fortran 90的编译的DLL为32位的。在FORTRAN DLL中的函数是相当简单:你把数据,你拉的数据输出;没有任何形式的状态。我们也不用花大量的时间,一共有也许3%,但它执行的计算逻辑是非常宝贵的。

I have an application that we're trying to migrate to 64bit from 32bit. It's .NET, compiled using the x64 flags. However, we have a large number of DLLs written in FORTRAN 90 compiled for 32bit. The functions in the FORTRAN DLLs are fairly simple: you put data in, you pull data out; no state of any sort. We also don't spend a lot of time there, a total of maybe 3%, but the calculation logic it performs is invaluable.

我可以以某种方式实现从64位code中的32位的DLL? MSDN表明,我不能,期。我做了一些简单的黑客和验证了这一点。一切都抛出一个无效的入口点异常。唯一可能的解决方案,我发现到目前为止是创建COM +封装所有的32位的DLL函数,并从64位程序调用COM。这似乎是一个相当头疼。我们还可以在魔兽世界仿真运行过程中,但随后的内存上限将不会增加,封盖大约1.6GB。

Can I somehow call the 32bit DLLs from 64bit code? MSDN suggests that I can't, period. I've done some simple hacking and verified this. Everything throws an invalid entry point exception. The only possible solution i've found so far is to create COM+ wrappers for all of the 32bit DLL functions and invoke COM from the 64bit process. This seems like quite a headache. We can also run the process in WoW emulation, but then the memory ceiling wouldn't be increased, capping at around 1.6gb.

有没有从64位CLR过程调用32位的DLL任何其他方式?

Is there any other way to call the 32bit DLLs from a 64bit CLR process?

推荐答案

您将需要有32位DLL加载到一个单独的32位进程,和你的64位进程通过进程间通信与它通信。我不认为有什么办法一个32位的DLL可以加载到64位进程并非如此。

You'll need to have the 32-bit dll loaded into a separate 32-bit process, and have your 64 bit process communicate with it via interprocess communication. I don't think there is any way a 32-bit dll can be loaded into a 64 bit process otherwise.

在这里有一个pretty的好文章:

There is a pretty good article here:

从64位code 访问32位DLL

这篇关于调用从64位进程的32位code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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