I am trying to call a Delphi function from C # ASP.NET code. The function declaration is as follows:
function SomeFunction(const someString, SomeOtherString: string): OleVariant;
From my C # code, I have this code:
[DLLImport(MyDLL.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]
public static extern object SomeFunction(string someString, string SomeOtherString);
Every time I call this method and save it as an object, I get a P / Invoke error. I have never called unmanaged code from my C # before, so I'm a bit confused.
source
share