32bit dll in 64bit application in c#

后端 未结 3 1461
清歌不尽
清歌不尽 2020-12-20 20:49

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.

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-20 21:09

    You cannot load a 32-bit DLL into a 64-bit process on Windows.

    I have never tried it myself, but you might be able to create a seperate 32-bit application that can run in a different process and act as a proxy for the DLL. Your application could then run 64-bit and communicate with the DLL with remote procedure calls over WCF.

    If performance is a concern, then your best bet would be to rebuild the DLL in 64-bit, if possible.

提交回复
热议问题