在C#中的64位应用程序的32位的DLL应用程序、DLL

2023-09-07 22:54:29 作者:  哈'我还是放不下她

您好 我想在C#中64位应用程序,我wan't它使用C ++ Builder中(32位)创建的DLL。但是,当我尝试加载DLL的应用程序崩溃。当内置的32bit它的工作原理。有没有一种方法来使用这个DLL的64位应用程序?

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.

如果你需要c您需要使用多个进程,以配合32位和64位$ C $。在这种情况下,虽然我只想让应用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