编辑:我在下面发布了一个更好的实现.我把它留在这里,所以回答是有道理的.
我已经为在Delphi中编写DLL的正确方法进行了大量搜索,并且能够从C#调用它,传递和返回字符串.许多信息不完整或不正确.经过多次试验和错误,我找到了解决方案.
这是使用Delphi 2007和VS 2010编译的.我怀疑它在其他版本中也能正常工作.
这是Delphi代码.请记住在项目中包含版本信息.
library DelphiLibrary;
uses SysUtils;
// Compiled using Delphi 2007.
// NOTE: If your project doesn't have version information included, you may
// receive the error "The "ResolveManifestFiles" task failed unexpectedly"
// when compiling the C# application.
{$R *.res}
// Example function takes an input integer and input string, and returns
// inputInt + 1, and inputString + ' ' + IntToStr(outputInt) as output
// parameters. If successful, the return result is nil (null), otherwise …Run Code Online (Sandbox Code Playgroud) 有没有人知道Delphi XE(我在这里说的是VCL)是否有任何使用数据感知控件的通用集合类?换句话说,是否有任何通用类,如TObjectList <>可以分配给TDataSource.DataSet,或类似的东西?
谢谢.
担