I have project where a c# GUI calls a fortran subroutine. The program passes integrers, floats, arrays, and strings. I built the c# program originally with .NET 2.0 without problems, then .NET 3.0, and even .NET 3.5 without any issue. When I try to upgrade my c# program to .NET 4.0 I suddenlt start to get string errors. What has worked in the past for the string definition (much thanks to help from this forum) is as follows:
C# - [MarshalAs(UnmanagedType.LPStr] string logfile
Fortran - character*255 logfile.
Now I am getting the error: forrtl:severe (408): fort: (18): Dummy character variable 'LOGFILE' has length 255 which is greater than actual variable length 0.
I know in VB there were issues with having to sneak in the string length into the argument pass, but I have had no problems with this project as it is currently written until I moved over to .NET 4.0 (which I need to do). Anyone have any advice?