<?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 Calling C++ Class methods from Fortran in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Calling-C-Class-methods-from-Fortran/m-p/985785#M27101</link>
    <description>I'm just trying to clarify whether or not it is possible to call a member function of a C++ Object from Fortran. &lt;BR /&gt; &lt;BR /&gt;I'm assuming it's not possible but the way to get around it, would be to call a regular static C function which would then be used as a link between the desired Object's method and Fortran. &lt;BR /&gt; &lt;BR /&gt;Thanking whoever can clarify this in advance, &lt;BR /&gt;Dawkins</description>
    <pubDate>Fri, 08 Mar 2002 11:12:20 GMT</pubDate>
    <dc:creator>jmdawk</dc:creator>
    <dc:date>2002-03-08T11:12:20Z</dc:date>
    <item>
      <title>Calling C++ Class methods from Fortran</title>
      <link>https://community.intel.com/t5/Software-Archive/Calling-C-Class-methods-from-Fortran/m-p/985785#M27101</link>
      <description>I'm just trying to clarify whether or not it is possible to call a member function of a C++ Object from Fortran. &lt;BR /&gt; &lt;BR /&gt;I'm assuming it's not possible but the way to get around it, would be to call a regular static C function which would then be used as a link between the desired Object's method and Fortran. &lt;BR /&gt; &lt;BR /&gt;Thanking whoever can clarify this in advance, &lt;BR /&gt;Dawkins</description>
      <pubDate>Fri, 08 Mar 2002 11:12:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Calling-C-Class-methods-from-Fortran/m-p/985785#M27101</guid>
      <dc:creator>jmdawk</dc:creator>
      <dc:date>2002-03-08T11:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calling C++ Class methods from Fortran</title>
      <link>https://community.intel.com/t5/Software-Archive/Calling-C-Class-methods-from-Fortran/m-p/985786#M27102</link>
      <description>As you probably know, C++ member functions have &lt;CODE&gt;this&lt;/CODE&gt; as the first hidden parameter; thus, in theory, you could call them from Fortran provided you get a C pointer to the class object somehow, write a proper INTERFACE block and call the method, passing the pointer as the first argument. &lt;BR /&gt; &lt;BR /&gt;Another issue could be calling conventions; AFAIK MSVC++ uses __fastcall as the default, where two arguments are passed through registers and the rest using stack. I don't know the details (and I'm not even sure about the above statement), but that cannot be emulated in VF. Thus, I think you'd be able to do it only if you declare the member functions __stdcall or __cdecl in VC++. (If it's another compiler, check the documentation about default calling convention). Note also that MSVC mangles names in a naughty way by default (e.g. &lt;CODE&gt;?_Foo@YAXXUZ&lt;/CODE&gt;), so your INTERFACE block must take that into account too. &lt;BR /&gt; &lt;BR /&gt;Jugoslav</description>
      <pubDate>Mon, 11 Mar 2002 20:06:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Calling-C-Class-methods-from-Fortran/m-p/985786#M27102</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2002-03-11T20:06:19Z</dc:date>
    </item>
  </channel>
</rss>

