c#中64位应用程序中的32位dll [英] 32bit dll in 64bit application in c#

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

问题描述

你好
我想在 c# 中创建一个 64 位应用程序,我不想在其中使用在 C++ builder(32 位)中创建的 dll.但是当我尝试加载 dll 时,应用程序崩溃了.当内置 32 位时,它可以工作.有没有办法在 64 位应用程序中使用这个 dll?

Hello
I want to create a 64bit application in c# and I wan't to use in it a dll created in C++ builder (32bit). But when I try to load the dll the application crashes. When built in 32bit it works. Is there a way to use this dll in a 64bit app?

推荐答案

不,这是不可能的.Windows 中的进程是 32 位或 64 位,它只能加载匹配的 DLL.任何加载不匹配的 DLL 的尝试都将失败并产生错误.

No this is not possible. A process in Windows is either 32 or 64 bit and it can only load DLL's which match. Any attempt to load a DLL which does not match will fail and produce an error.

如果需要匹配 32 位和 64 位代码,则需要使用多个进程.在这种情况下,虽然我只会使应用程序成为 32 位或 DLL 64 位

If you need to match 32 and 64 bit code you need to use multiple processes. In this case though I would just make the application 32 bit or the DLL 64 bit

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

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