简体   繁体   中英

Using classes exported by C# dll in Delphi

I found that there is no way to export a class in Delphi dll. Now I want to use a class exported in a dll file written by C# (ie TLSharp class) Is there any way to use this class objects and methods in Delphi?

PS: I meant using classes exported in a C# dll file in a Delphi program, not using a Delphi dll in a C# program explained at: Delphi's interoperability with .NET

I haven't detail information but I can give you a start position. Dll communication managed my operation system. So there is some limits. Data types are limited with primitive data types (long, int, pointer, char, etc). So you cannot share class method between delphi and c# (as pointer yes). You need to develop your communication without using class method. You can create object from class in your dll. Then access it is properties and methods with primitive method. I try to implement embedded mysql library to C# which is developed in C++. May be this open source project give you start point.

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