I have an existing VB6 program that calls a Fortran DLL with the following definition:
Declare Function START Lib "BackEndLib2.dll" Alias "_START@0" () As Integer
We are trying to port a VB6 application to C # (.net 4.0), and now this definition looks like this:
[DllImport("BackEndLib2.dll", EntryPoint = "_START@0")]
public static extern short START();
However, when I call the same function call in C #, it makes a dll call, it successfully returns to the managed code and throws an exception after a while.
I also tried the same dll call in VB.net with the same result:
Declare Function START Lib "BackEndLib2.dll" Alias "_START@0" () As Short
Any idea why the same function call throws an exception in .NET 4.0 but works successfully in vb6?
I assume that I damage the stack with the dll call, but I'm not sure. I tried many different types of parameters, but so far nothing has worked.
: WPF, Windows Forms, .