Create a C# DLL That Can Be Imported in a Delphi App Using stdcall - Possible?

后端 未结 9 1635
孤城傲影
孤城傲影 2020-12-09 19:35

I have a program that I need to create a DLL for, hopefully in C#. The program is written in Delphi and I have an interface file to code to. The interface uses the stdcall

9条回答
  •  情深已故
    2020-12-09 20:29

    This is not directly possible. C# is managed code. This means that it requires a very specific runtime environment in order to function, an environment which Delphi could not directly provide to it. It is not like C where you simply find the address and calling convention of the function and call it.

    However, it is possible to host the Common Language Runtime inside of a Delphi application (or any other Windows application). I have no idea how to do this. I just know that it's possible. (It's quite likely that's what this 'Hydra' that Steve mentioned will do.)

提交回复
热议问题