I’m having a problem, I’ve been trying to solve it since yesterday but no luck.
I have a 32-bit Delphi DLL which I want to import it in to a .NET WIN Application. This application has to be built on ANY CPU mode. Of course, the exception BadImageFormatException is thrown, which means that 64-bit applications can’t load x86 DLLs.
I googled around and found a solution, it said that I have to do wrapper, but it wasn’t clear for me. Can anyone tell me how to solve this problem, is there any possible way that I can import a 32-bit Delphi DLL in to a program built under any CPU architecture (64-bit, 32-bit) or maybe another solution?
I’m having a problem, I’ve been trying to solve it since yesterday but no
Share
A general idea could be to wrap your (unmanaged) 32-bit DLL with a managed 32-bit wrapper dll and make it COM visible. This allows calls to your wrapper DLL via its COM interface.
You can than use a COM surrogate to make your COM dll appear as an out of process COM server.
Take a look at this SO question for some further information on this topic: Access x86 COM from x64 .NET.