>> I'm not familiar with the old stuff at all
Hmm, I was reading along, somewhat sympathetic to your plight - and here I nearly lost any interest ...
Which fortran compiler are you using? Intel,GNU, other? This is important because there is something that is called a "calling convention" that might differ between the compilers: Calling convention
Now, if you are using the Intel compiler:
In C and C++, you can specify the __stdcall calling convention by using the
keyword in a function definition. This is the calling convention used to call most of the Windows API functions.
The following C language function definition allows you to call to a fortran subroutine using the __stdcall calling convention:
extern void __stdcall CALCULTE_SOMETHING_IN_FORTRAN (int n);
There is also the ATTRIBUTES directive, which allows a fortran subroutine to be called using the c calling convention:
SUBROUTINE CALCULTE_SOMETHING_IN_FORTRAN (I)
!DEC$ ATTRIBUTES C :: CALCULTE_SOMETHING
Here is a link you may find useful:
Fortran/MASM Calling Conventions
] - so that you get the idea about why calling conventions matter ...
As for:No, We need the DLL to be .NET, the purpose of doing this is to start migrating the system to .NET, step by step, and function by function
If the code works, why on earth would you do someting like that?