<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calling Visual Fortran DLL from Visual C# in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Visual-Fortran-DLL-from-Visual-C/m-p/840637#M58606</link>
    <description>The &lt;A href="http://www.canaimasoft.com/f90VB/OnlineManuals/Default.htm"&gt;Canaima Software Web site&lt;/A&gt; has some good manuals and tutorials about calling Visual Fortran from Visual Basic. I think that they contain a discussion of passing strings that may help you.&lt;BR /&gt;&lt;BR /&gt;Mike</description>
    <pubDate>Fri, 23 Aug 2002 19:13:06 GMT</pubDate>
    <dc:creator>durisinm</dc:creator>
    <dc:date>2002-08-23T19:13:06Z</dc:date>
    <item>
      <title>Calling Visual Fortran DLL from Visual C#</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Visual-Fortran-DLL-from-Visual-C/m-p/840634#M58603</link>
      <description>&lt;BR /&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I am writing an application using Visual C# .NET.  The application calls Visual Fortran 6.6A subroutines in a DLL.&lt;BR /&gt;&lt;BR /&gt;I have been able to call test Fortran subroutines in the DLL from C#, change values in floating point and integer arrays in the subroutines and pass the new values back to C#.&lt;BR /&gt;&lt;BR /&gt;I am having trouble passing string values to a Fortran subroutine.  I can pass one string and access the string.  I was able to use a System.Text.Stringbuilder and with some odd manipulation in C# of the returned values, I was able to change the string in a subroutine and pass the new string back to C#.  But I cannot pass more than one string.&lt;BR /&gt;&lt;BR /&gt;Please reply with any suggestions or hints you might have for this.  Thank you.&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Kim&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Aug 2002 04:26:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Visual-Fortran-DLL-from-Visual-C/m-p/840634#M58603</guid>
      <dc:creator>kim7</dc:creator>
      <dc:date>2002-08-22T04:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Visual Fortran DLL from Visual C#</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Visual-Fortran-DLL-from-Visual-C/m-p/840635#M58604</link>
      <description>Fortran strings are passed with a hidden length. Visual Fortran's on-line help has a "mixed-language programming" topic under the "Strings" heading that explains a lot about this. There is no specific information about exchanging strings between C# and Fortran, but it will probably help you. The example programs that come with VF include ones dealing with passing strings.&lt;BR /&gt;&lt;BR /&gt;Mike</description>
      <pubDate>Thu, 22 Aug 2002 19:28:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Visual-Fortran-DLL-from-Visual-C/m-p/840635#M58604</guid>
      <dc:creator>durisinm</dc:creator>
      <dc:date>2002-08-22T19:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Visual Fortran DLL from Visual C#</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Visual-Fortran-DLL-from-Visual-C/m-p/840636#M58605</link>
      <description>Mike,&lt;BR /&gt;&lt;BR /&gt;Thanks much for your reply.  I have printed out the Visual Fortran help information on mixed languaged programming and strings and think this is key information.  I do not have success to report yet and will work on this again on Monday when a colleague with much expertise in Fortran returns from vacation.&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;&lt;BR /&gt;Kim&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Aug 2002 22:17:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Visual-Fortran-DLL-from-Visual-C/m-p/840636#M58605</guid>
      <dc:creator>kim7</dc:creator>
      <dc:date>2002-08-22T22:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Visual Fortran DLL from Visual C#</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Visual-Fortran-DLL-from-Visual-C/m-p/840637#M58606</link>
      <description>The &lt;A href="http://www.canaimasoft.com/f90VB/OnlineManuals/Default.htm"&gt;Canaima Software Web site&lt;/A&gt; has some good manuals and tutorials about calling Visual Fortran from Visual Basic. I think that they contain a discussion of passing strings that may help you.&lt;BR /&gt;&lt;BR /&gt;Mike</description>
      <pubDate>Fri, 23 Aug 2002 19:13:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Visual-Fortran-DLL-from-Visual-C/m-p/840637#M58606</guid>
      <dc:creator>durisinm</dc:creator>
      <dc:date>2002-08-23T19:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Visual Fortran DLL from Visual C#</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Visual-Fortran-DLL-from-Visual-C/m-p/840638#M58607</link>
      <description>&lt;BR /&gt;Mike,&lt;BR /&gt;&lt;BR /&gt;Thanks for the additional site.  I am keeping it for future reference.&lt;BR /&gt;&lt;BR /&gt;I found an &lt;A href="http://www.compaq.com/fortran/examples/vc-example1.html"&gt;example from the Compaq Fortran web site&lt;/A&gt; to be helpful.&lt;BR /&gt;&lt;BR /&gt;This morning we successfully passed from Visual C# to Visual Fortran a string by value (not to be changed) and another string by reference (changed on the Fortran side and successfully read back on the C# side).&lt;BR /&gt;&lt;BR /&gt;C# programmers, also look at the "Platform Invoke Tutorial" in Help for Visual Studio.&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;&lt;BR /&gt;Kim&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;U&gt;Visual C#&lt;/U&gt;&lt;BR /&gt;&lt;BR /&gt;using System.Runtime.InteropServices; &lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;[DllImport("TestFOR.dll")]&lt;BR /&gt;public static extern void HELLO_S(&lt;BR /&gt;	[MarshalAs(UnmanagedType.LPStr)]&lt;BR /&gt;	System.Text.StringBuilder TEST,&lt;BR /&gt;	[MarshalAs(UnmanagedType.I4)]&lt;BR /&gt;	int TEST_LEN,&lt;BR /&gt;	[MarshalAs(UnmanagedType.LPStr)]&lt;BR /&gt;	System.Text.StringBuilder MESSAGE,&lt;BR /&gt;	[MarshalAs(UnmanagedType.I4)]&lt;BR /&gt;	int MESSAGE_LEN); &lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;StringBuilder TEST = new StringBuilder("TESTVAL"); &lt;BR /&gt;StringBuilder MESSAGE = new StringBuilder("01234567890123456789012345678901234567890123456789012345678901234567890123456789");	// 80 chars. max&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;HELLO_S(TEST, TEST.Length, MESSAGE, MESSAGE.Length); &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;U&gt;Visual Fortran&lt;/U&gt;&lt;BR /&gt;&lt;BR /&gt;       SUBROUTINE HELLO_S(TEST,MESSAGE)&lt;BR /&gt;&lt;BR /&gt;  ! Expose subroutine HELLO_S to users of this DLL&lt;BR /&gt;  !&lt;BR /&gt;  !DEC$ ATTRIBUTES DLLEXPORT::HELLO_S&lt;BR /&gt;&lt;BR /&gt;      CHARACTER TEST*(*)&lt;BR /&gt;      CHARACTER MESSAGE*(*)&lt;BR /&gt;      WRITE(10,'(1X,A)') 'TEST="'//TEST//'"'&lt;BR /&gt;      IF(TEST.EQ.'TESTVAL') THEN&lt;BR /&gt;        WRITE(10,'(1X,A)') 'TEST.EQ.TESTVAL'&lt;BR /&gt;      ELSE&lt;BR /&gt;        WRITE(10,'(1X,A)') 'TEST.NE.TESTVAL'&lt;BR /&gt;      ENDIF&lt;BR /&gt;      L=LEN(TEST)&lt;BR /&gt;      WRITE(10,*) 'LEN(TEST)=',L&lt;BR /&gt;      L2=LEN(MESSAGE)&lt;BR /&gt;      WRITE(10,*) 'LEN(MESSAGE)=',L2&lt;BR /&gt;      WRITE(10,'(1X,A)') 'MESSAGE="'//MESSAGE//'"'&lt;BR /&gt;      MESSAGE='Test Message'//CHAR(0)&lt;BR /&gt;      WRITE(10,'(1X,A)') 'MESSAGE="'//MESSAGE//'"'&lt;BR /&gt;       RETURN&lt;BR /&gt;       END&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Sep 2002 00:58:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Visual-Fortran-DLL-from-Visual-C/m-p/840638#M58607</guid>
      <dc:creator>kim7</dc:creator>
      <dc:date>2002-09-05T00:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Visual Fortran DLL from Visual C#</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Visual-Fortran-DLL-from-Visual-C/m-p/840639#M58608</link>
      <description>Steve,&lt;BR /&gt;&lt;BR /&gt;Is this a good candidate to include with VF examples? More and more people are going to be mixing VF with .NET languages.&lt;BR /&gt;&lt;BR /&gt;Mike</description>
      <pubDate>Mon, 09 Sep 2002 19:07:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Visual-Fortran-DLL-from-Visual-C/m-p/840639#M58608</guid>
      <dc:creator>durisinm</dc:creator>
      <dc:date>2002-09-09T19:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Visual Fortran DLL from Visual C#</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Visual-Fortran-DLL-from-Visual-C/m-p/840640#M58609</link>
      <description>I'm sure we'll be adding examples like this in the future.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Mon, 09 Sep 2002 20:34:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Visual-Fortran-DLL-from-Visual-C/m-p/840640#M58609</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2002-09-09T20:34:33Z</dc:date>
    </item>
  </channel>
</rss>

