Using 32-bit library from 64-bit application with perl or neko

363 views Asked by At

I know, that it is very often question, but I want to know a little bit more on this subject.

We have application, written in C#, which is compiled to x64. It must be compiled to x64, because it is requirment of our customer. Recently, we discovered that we have old delphi code(sighs) with very helpful module, that I must test(double sighs). For some stupid reason, I must not compile this module with anything else then delphi 7. So I'm stuck with x32 .dll of this module and x64 application to use it.

I've already discovered workaround with IPC communications, but I'm familiar with perl and recently discovered neko. As far as I know perl is used for glue code and neko is used for sharing runtime between different languages. So maybe there is some workaround using perl, neko or something else?

Also, if you can provide any example code of sharing runtime between two languages in neko, I'll be ver grateful.

Thank you!

1

There are 1 answers

0
David Heffernan On BEST ANSWER

Neither Perl nor Neko are going to help you consume this 32 bit library in your 64 bit process. Were you to try to use either Perl or Neko you would just be injecting even more layers in between your two modules.

You will need to use IPC of one form or another. There are many ways to do that. You could create a 32 bit C# host process for the 32 bit library, and then communicate between the 32 and 64 bit C# processes using one of the standard .net IPC frameworks.

However, this does look like a good fit for an out-of-process COM solution. Create an out-of-process COM server that exposes the functionality of the 32 bit DLL. Consume that COM server from your 64 bit process as you would any other COM server.