Tag: delphi xe2

从C#调用Delphi函数

我有一个下面的DLL源代码。 library Project1; uses System.SysUtils, System.Classes; type IStringFunctions = interface [‘{240B567B-E619-48E4-8CDA-F6A722F44A71}’] function GetMethodValueAsString():PAnsiChar; stdcall; end; TStringFunctions = class(TInterfacedObject, IStringFunctions) public function GetMethodValueAsString():PAnsiChar; stdcall; end; {$R *.res} function TStringFunctions.GetMethodValueAsString():PAnsiChar; stdcall; begin Result := ‘test’; end; procedure GetImplementation(out instance:IStringFunctions); stdcall; export; begin instance := TStringFunctions.Create; end; exports GetImplementation; begin end. 我想在C#中使用这样的 using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; […]