Can somebody please point out what I'm doing wrong here?
FORTRAN 77 dll code
*$pragma aux DON "DON" export parm(value*8,value*8)
SUBROUTINE DON(DAA,DBB,DCC)
REAL*8, DAA,DBB,DCC
DBB=DAA+1
DCC=DBB+1
RETURN
END
C# code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Diagnostics;
namespace pDON
{
class Program
{
[DllImport("DON.dll",
CharSet = CharSet.Auto,
CallingConvention = CallingConvention.StdCall)]
public static extern void DON(
[MarshalAs(UnmanagedType.R8)] double DAA,
[MarshalAs(UnmanagedType.R8)] double DBB,
[MarshalAs(UnmanagedType.R8)] double DCC
);
static void Main(string[] args)
{
//double TIME = 100.0;
double DAA = 5.5;
double DBB = 7;
double DCC = 9;
//START( ENERIN, VAL1);
DON(DAA, DBB, DCC);
Console.Write("val1 = " + DBB);
Console.Write("val2 = " + DCC);
Debug.WriteLine("VAR = " + DBB.ToString());
Console.Write("Press any key to exit");
Console.ReadKey(false);
}
}
}
I want to get the values of DBB DCC back to C# main prog ..after they are processed thru FORTRAN 77 subroutine.
P.S. : i can not use INTENT(out) as i m using fortran 77. much thanks in advance.