开发者

I have a c sharp dll. How can I make it usable in other languages, such as PHP or Delphi?

I have a dll developed in C Sharp. How can I make it usable in other languages, such as PHP or Delphi?

I cannot find any solution to this problem yet. Isn't there any easy开发者_Go百科 way of doing this?


If Delphi can understand COM, then you can make a COM wrapper around the .NET DLL.

I am doing this now for an older IDE which doesn't understand .NET, but it understands COM so I am able to use the latest .NET features in my older applications.


In addition to COM, you could try these (from my Delphi Win32 to WCF answer) for Delphi Win32:

  • Use Delphi Prism with the UnmanagedExport attribute to create a .NET wrapper that you can call from native Delphi Win32
  • Use Managed VCL to do .NET interop from native Delphi Win32
  • From another Stackoverflow question: create a C++ DLL crossing the bridge this used "mixed mode C++"
  • Use RemObjects Hydra on both the C# or Delphi Prism and native Delphi Win32 side (RemObjects wrote Delphi Prism, so this works like a charm)

The last one might be the real one you are after.

For PHP it is a different story;

  • PHP might run on a non-Windows box,
  • there are .NET implementations of PHP that would allow for direct linking of your C# assembly DLL

--jeroen

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜