I am trying to call a Delphi function from C# ASP.NET code. The function's declaration looks like this:
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 store it as an object, I get a P/Invoke error. I've never called unmanaged code from my C# before, so I'm kind of at a loss.