Reputation: 7575
I came across Unmanaged exports technique in this anwser on SO.
I managed to build the following code :
using System;
using System.Collections.Generic;
using System.Text;
using RGiesecke.DllExport;
namespace DelphiNET
{
internal static class UnmanagedExports
{
[DllExport("add", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
public static int add(int left, int right) {
return left + right;
}
}
}
I probed it with Delphi but was in vain.
I checked the output dll with a PE editor but It turned out to have no export data at all.
I miss something and I'm confused.
Edit:
Please - Help me fix the trouble
Upvotes: 1
Views: 1766
Reputation: 612794
I managed to get this to work like this:
Note that the path to find the DLL is bin\Debug\x86
. There is a DLL in bin\Debug
but this has no exports. Perhaps that's what you have been looking at.
Upvotes: 1