简体   繁体   中英

Can I use managed C# DLL in unmanaged Delphi EXE?

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?

There are quite a few options, including at least the following:

  1. Expose the classes that you need via COM which can be readily consumed by Delphi.
  2. 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.
  3. Use Robert Giesecke's UnmanagedExports .
  4. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM