创建可以德尔福应用程序中使用STDCALL要导入的C#DLL - 可能吗? [英] Create a C# DLL That Can Be Imported in a Delphi App Using stdcall - Possible?

查看:257
本文介绍了创建可以德尔福应用程序中使用STDCALL要导入的C#DLL - 可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个程序,我需要建立一个DLL,希望在C#。该程序是用Delphi编写的,我有一个接口文件code到。该接口使用stdcall调用约定。

I have a program that I need to create a DLL for, hopefully in C#. The program is written in Delphi and I have an interface file to code to. The interface uses the stdcall calling convention.

是否有可能创建一个符合接口,可在Delphi应用程序可以使用C#DLL?

Is it possible to create a C# DLL that conforms to the interface and can be used in the Delphi application?

有一些样本code,演示了如何code中的C#DLL到STDCALL接口方法?

Is there some sample code that demonstrates how to code the C# DLL to a stdcall interface method?

推荐答案

这是不是在纯C#可能的,但这是一篇文章介绍了如何在非管理的导出表添加到您的C#库,然后可以在任何其他语言中使用。请注意,以闪电战的引用成群不应该把你关 - 它们涉及到作者自己的背景和无关的基本概念以及它是如何工作的。

This is not possible in pure C#, but this is an article that shows how to add an unmanaged export table to your C# library, which can then be used in any other language. Note that the hordes of references to Blitz should not put you off - they relate to the author's own context and have nothing to do with the basic concept and how it works.

还有一个在布赖恩·朗的一个会议论文的部分。在转弯时,你可以看到的有些讽刺,Delphi.Net居然直接尽管C#不这样做支持非托管的出口。我不知道如果这是德尔福棱镜也是如此。

There is also a section in Brian Long's one conference paper. In a twist that you could see as somewhat ironic, Delphi.Net actually supported unmanaged exports directly despite C# not doing so. I have no idea if this is true of Delphi Prism as well.

这篇关于创建可以德尔福应用程序中使用STDCALL要导入的C#DLL - 可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆