<?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 Passing derived types, vb.net and fortran dll in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-derived-types-vb-net-and-fortran-dll/m-p/804724#M39620</link>
    <description>I assume that VB derived types with arrays would have pointers to a SafeArray structure. This is not something we have looked at. There are two examples of VB.Net calling Fortran, one of which deals with SafeArrays as a routine argument. I suggest you look at this. These examples are in MixedLanguage.zip.</description>
    <pubDate>Wed, 15 Jun 2011 19:00:50 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2011-06-15T19:00:50Z</dc:date>
    <item>
      <title>Passing derived types, vb.net and fortran dll</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-derived-types-vb-net-and-fortran-dll/m-p/804723#M39619</link>
      <description>I want to passderived types between a vb.net GUI and a Fortran dll. I would like the derived type to contain 1D and 2D arrays. Is any of this possible? I can't seem to find a complete and clear example of this and would appreciate some advice or if it's not possible to know for sure. Or know the limitations if some of it is possible but maybe not the arrays. &lt;BR /&gt;&lt;BR /&gt;If derived types aren't possible what about 2D arrays not in a derived type? I've read where people have had trouble with this but again can't find a complete and clear example of it working.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Wed, 15 Jun 2011 18:20:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-derived-types-vb-net-and-fortran-dll/m-p/804723#M39619</guid>
      <dc:creator>craig_h</dc:creator>
      <dc:date>2011-06-15T18:20:20Z</dc:date>
    </item>
    <item>
      <title>Passing derived types, vb.net and fortran dll</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-derived-types-vb-net-and-fortran-dll/m-p/804724#M39620</link>
      <description>I assume that VB derived types with arrays would have pointers to a SafeArray structure. This is not something we have looked at. There are two examples of VB.Net calling Fortran, one of which deals with SafeArrays as a routine argument. I suggest you look at this. These examples are in MixedLanguage.zip.</description>
      <pubDate>Wed, 15 Jun 2011 19:00:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-derived-types-vb-net-and-fortran-dll/m-p/804724#M39620</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-06-15T19:00:50Z</dc:date>
    </item>
    <item>
      <title>Passing derived types, vb.net and fortran dll</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-derived-types-vb-net-and-fortran-dll/m-p/804725#M39621</link>
      <description>Steve&lt;BR /&gt;The example that deals with safearray structures passes an array of strings. If I want to pass an array of reals or integers would I stilluse asafearray along withthe BSTRPtr and ConvertBSTRToString function? How wouldthe methodologydiffer? How would I convert it to a real? Is there an easier more direct way of doing this?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Jun 2011 00:16:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-derived-types-vb-net-and-fortran-dll/m-p/804725#M39621</guid>
      <dc:creator>craig_h</dc:creator>
      <dc:date>2011-06-21T00:16:03Z</dc:date>
    </item>
    <item>
      <title>Passing derived types, vb.net and fortran dll</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-derived-types-vb-net-and-fortran-dll/m-p/804726#M39622</link>
      <description>You wouldn't use the BSTR stuff with reals or integers. So where the code calls SafeArrayGetElement, the pointer is to a REAL (or INTEGER or whatever) not a BSTR. So instead of:&lt;BR /&gt;&lt;BR /&gt;integer(int_ptr_kind()) :: BSTRPTR&lt;BR /&gt;&lt;BR /&gt;you might have:&lt;BR /&gt;&lt;BR /&gt;real :: real_element&lt;BR /&gt;pointer (p_real, real_element)&lt;BR /&gt;&lt;BR /&gt;and then pass loc(p_real) as the last argument to SafeArrayGetElement. You could then use variable real_element.&lt;BR /&gt;&lt;BR /&gt;There might be a shortcut to access a section of an array but I'd have to play with it to see.</description>
      <pubDate>Tue, 21 Jun 2011 01:40:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-derived-types-vb-net-and-fortran-dll/m-p/804726#M39622</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-06-21T01:40:23Z</dc:date>
    </item>
    <item>
      <title>Passing derived types, vb.net and fortran dll</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-derived-types-vb-net-and-fortran-dll/m-p/804727#M39623</link>
      <description>I have no experience of derived types in VB .NET, but it is straightforward to pass arrays from VB .NET to Fortran without having to resort to SafeArrays. I attach sample code for the Visual Basic side to pass 2D arrays of Doubles, Integers and Longs and and the Fortran code required to receive them on the Fortran side.&lt;BR /&gt;&lt;BR /&gt;All you need to remember this time is that VB .NET stores array elements in row-major order (as opposed to VBA in Excel which appears to store arrays in column-major order as per Fortran!). &lt;BR /&gt;&lt;BR /&gt;The VB .NET code sets array value (i,j) = the decimal number 'ij' so that you can immediately see on the Fortran side the array indexes that VB .NET used for a received array value (as you can see in the Debug Screen-shot also attached).&lt;BR /&gt;&lt;BR /&gt;P.S. I used Microsoft Visual Basic 2008 Express Edition which uses the .NET Framework&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Jun 2011 12:45:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-derived-types-vb-net-and-fortran-dll/m-p/804727#M39623</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2011-06-21T12:45:14Z</dc:date>
    </item>
  </channel>
</rss>

