Here is a very quick sample explains how to make dll in Delphi and then how to call it from C#.
Here is Delphi code of simple dll with one function SayHello:
library DllDemo;
uses
Dialogs;
{$R *.res}
Procedure SayHello;StdCall;
Begin
ShowMessage('Hello from Delphi');
End;
exports
SayHello;
begin
end.
Compile this code and it will produce a dll file.
now, the C# code to call the previous procedure in the dll is like this:
using System.Runtime.InteropServices;
namespace CallDelphiDll
{
class Program
{
static void Main(string[] args)
{
SayHello();
}
[DllImport("DllDemo")]
static extern void SayHello();
}
}
Put the Delphi produced dll in the C# project output directory and run the C# application.
Now, expand this simple sample to achieve your requirement.