How can I call a 32-bit DLL from 64-bit code?

后端 未结 3 1071
感情败类
感情败类 2020-12-19 03:27

I have some 32-bit DLLs that don\'t have matched 64-bit DLLs. How can I invoke these DLLs from a 64-bit application written in Delphi XE2?

3条回答
  •  醉话见心
    2020-12-19 03:57

    You can use the same exact technique used to call 64 bit dlls from 32 bit code.

    See http://cc.embarcadero.com/Item/27667

    "Just" make the contrary: run a background 32 bit process, the communicate from your 64 bit process with it using a memory mapped buffer.

    But this is definitively not an easy task. You'll have to rewrite some asm code. I wrote some article about how it works.

    The out-of-process COM option is perhaps the easiest to implement. Or use a more simple IPC - like WM_COPYDATA message or any other mean. But you'll definitively need another 32 bit process to link to the 32 bit libraries.

提交回复
热议问题