简体   繁体   English

在Delphi中使用C#dll导出的类

[英]Using classes exported by C# dll in Delphi

I found that there is no way to export a class in Delphi dll. 我发现没有办法在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? 现在,我想使用在C#编写的dll文件中导出的类(即TLSharp类),是否可以在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 PS:我的意思是在Delphi程序中使用C#dll文件中导出的类,而不是在C#程序中使用Delphi dll,其解释如下: Delphi与.NET的互操作性

I haven't detail information but I can give you a start position. 我没有详细的信息,但是我可以给您一个开始的位置。 Dll communication managed my operation system. DLL Communication管理着我的操作系统。 So there is some limits. 因此有一些限制。 Data types are limited with primitive data types (long, int, pointer, char, etc). 数据类型受原始数据类型(long,int,指针,char等)限制。 So you cannot share class method between delphi and c# (as pointer yes). 因此,您不能在delphi和c#之间共享类方法(作为指针,是)。 You need to develop your communication without using class method. 您需要在不使用类方法的情况下进行交流。 You can create object from class in your dll. 您可以从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++. 我尝试将嵌入式mysql库实现为用C ++开发的C#。 May be this open source project give you start point. 可能是这个开源项目为您提供了起点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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