Use c++/cli or interop, easier and less error prone. See:
Consuming Unmanaged DLL Functions[
^]
Here is a small example on exporting dll functions from Delphi:
http://delphi.about.com/od/windowsshellapi/a/dll_basics.htm[
^]
example:
using System.Runtime.InteropServices;
public class Win32 {
[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr MessageBox(int hWnd, String text,
String caption, uint type);
}
public class HelloWorld {
public static void Main() {
Win32.MessageBox(0, "Hello World", "Platform Invoke Sample", 0);
}
}
Regards
Espen Harlinn