Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

C# string problems with .net 4.0

$
0
0

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?


Viewing all articles
Browse latest Browse all 5691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>