Can I use managed C# DLL in unmanaged Delphi EXE? Or the only way is to have managed DLL and EXE or unmanaged DLL and EXE?
Asked
Active
Viewed 1,315 times
1 Answers
5
There are quite a few options, including at least the following:
- Expose the classes that you need via COM which can be readily consumed by Delphi.
- Create a mixed mode C++/CLI wrapper that uses the C# DLL as a reference. That mixed mode DLL can export native functions and you can then consume that DLL using Delphi
external
. That is, you consume the DLL just in the same way as Windows system DLLs are consumed. - Use Robert Giesecke's UnmanagedExports.
- Use the CLR's native API to consume the C# DLL directly. This option is probably the least attractive since it's the hardest to get right.

David Heffernan
- 601,492
- 42
- 1,072
- 1,490
-
2Do not forget http://www.remobjects.com/hydra and http://interop.managed-vcl.com/netinterop_csharp.php – Arnaud Bouchez Jul 30 '13 at 13:44
-
This link provides some more information about different options: http://www.xinterop.com/index.php/2015/04/30/introduction-to-the-xinterop-net-bridge/ – Niklas Peter Sep 06 '15 at 17:13