<?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: dll stdcall convention for vba in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/dll-stdcall-convention-for-vba/m-p/938269#M16393</link>
    <description>Steve, Made the changes and everything works now. Thanks!</description>
    <pubDate>Fri, 09 Feb 2001 03:04:26 GMT</pubDate>
    <dc:creator>pecan204</dc:creator>
    <dc:date>2001-02-09T03:04:26Z</dc:date>
    <item>
      <title>dll stdcall convention for vba</title>
      <link>https://community.intel.com/t5/Software-Archive/dll-stdcall-convention-for-vba/m-p/938261#M16385</link>
      <description>Hello, I cannot get the string to pass to VA and suspect the stdcall to be incorrect? Can someone help?Option Explicit  &lt;BR /&gt;  &lt;BR /&gt;In VBA:  &lt;BR /&gt;Public Declare Sub CALL_string Lib "C:Program FilesMicrosoft Visual StudioMy Projectscall_stringcall_string.dll" Alias _  &lt;BR /&gt;          "_FCALL_STRING@4" (ByRef b As String)  &lt;BR /&gt; &lt;BR /&gt;'string fixed length  &lt;BR /&gt;Function Mod5()  &lt;BR /&gt;Static b As String * 4  &lt;BR /&gt;Call FCALL_string(b)  &lt;BR /&gt;Mod5 = b  &lt;BR /&gt;End Function  &lt;BR /&gt;  &lt;BR /&gt;In Fortran:  &lt;BR /&gt;subroutine FCALL_STRING(b)  &lt;BR /&gt;!DEC$ ATTRIBUTES DLLEXPORT::FCALL_STRING  &lt;BR /&gt;Character*4, intent(out) :: b  &lt;BR /&gt;b = 'boeh'  &lt;BR /&gt;end subroutine FCALL_STRING  &lt;BR /&gt;  &lt;BR /&gt;Thank you.</description>
      <pubDate>Thu, 08 Feb 2001 08:45:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/dll-stdcall-convention-for-vba/m-p/938261#M16385</guid>
      <dc:creator>pecan204</dc:creator>
      <dc:date>2001-02-08T08:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: dll stdcall convention for vba</title>
      <link>https://community.intel.com/t5/Software-Archive/dll-stdcall-convention-for-vba/m-p/938262#M16386</link>
      <description>The CVF online documentation is a very good resource.  The Programmer's Guide has a chapter on Programming with Mixed Languages.  It is required reading if you're doing mixed language programming.  That chapter has an '&lt;A href="mk:@MSITStore:C:Program%20FilesMicrosoft%20Visual%20StudioDF98DOCdfmain.chm::/pg/pgwvbusr.htm#stringex" target="_blank"&gt;example passing strings&lt;/A&gt; where 'the length of the string will be constant and known by both the Basic and Fortran code, so you do not need to pass the length to Fortran, but you need to tell Fortran not to expect its length'.  That example maps exactly to what you are trying to do.   &lt;BR /&gt; &lt;BR /&gt;However, I would not recommend hard coding in string lengths like that.  But hey, there's &lt;A href="http://www.compaq.com/fortran/examples/vb-example1.html" target="_blank"&gt;another CVF sample on their website&lt;/A&gt; that is more robust and shows how to pass the hidden length arguement that fortran expects for assumed length character dummy arguments. &lt;BR /&gt; &lt;BR /&gt;hth, &lt;BR /&gt;John</description>
      <pubDate>Thu, 08 Feb 2001 15:54:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/dll-stdcall-convention-for-vba/m-p/938262#M16386</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-02-08T15:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: dll stdcall convention for vba</title>
      <link>https://community.intel.com/t5/Software-Archive/dll-stdcall-convention-for-vba/m-p/938263#M16387</link>
      <description>Hello,  &lt;BR /&gt; &lt;BR /&gt;I'm aware of these examples and have tried them however , they fail to identify the proper stdcall parameter. &lt;BR /&gt; &lt;BR /&gt;I assummed it is "_FCALL_STRING@4" for this example. But it doesn't work. &lt;BR /&gt; &lt;BR /&gt;What should this parameter be for both of these examples? &lt;BR /&gt; &lt;BR /&gt;Anyone? Thanks.</description>
      <pubDate>Thu, 08 Feb 2001 23:13:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/dll-stdcall-convention-for-vba/m-p/938263#M16387</guid>
      <dc:creator>pecan204</dc:creator>
      <dc:date>2001-02-08T23:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: dll stdcall convention for vba</title>
      <link>https://community.intel.com/t5/Software-Archive/dll-stdcall-convention-for-vba/m-p/938264#M16388</link>
      <description>First, you have to change the VB declaration of the argument as ByVal instead of ByRef.  Then, add the following to your Fortran routine:&lt;BR /&gt;&lt;BR /&gt;!DEC$ ATTRIBUTES REFERENCE :: FCALL_STRING, B&lt;BR /&gt;&lt;BR /&gt;That should do what you want.  You need ByVal in VB which means "just pass an ASCII version of the string by reference".  Otherwise you get a "BSTRING" which Fortran doesn't know how to interpret directly.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Thu, 08 Feb 2001 23:36:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/dll-stdcall-convention-for-vba/m-p/938264#M16388</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-02-08T23:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: dll stdcall convention for vba</title>
      <link>https://community.intel.com/t5/Software-Archive/dll-stdcall-convention-for-vba/m-p/938265#M16389</link>
      <description>I used the above reference and changed to byval but I get a runtime error 453 cant find dll entry point. What do you think? &lt;BR /&gt; &lt;BR /&gt;I am still uncertain if the allias "_FCALLl_STRING@4" is correct?</description>
      <pubDate>Fri, 09 Feb 2001 01:42:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/dll-stdcall-convention-for-vba/m-p/938265#M16389</guid>
      <dc:creator>pecan204</dc:creator>
      <dc:date>2001-02-09T01:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: dll stdcall convention for vba</title>
      <link>https://community.intel.com/t5/Software-Archive/dll-stdcall-convention-for-vba/m-p/938266#M16390</link>
      <description>Well, the compiler is generating _FCALL_STRING@8 and it's expecting a second argument which is the length by value.  But the REFFERENCE keywords on the routine and argument SHOULD have avoided that - I don't understand why not.  I'll find out...&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Fri, 09 Feb 2001 02:32:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/dll-stdcall-convention-for-vba/m-p/938266#M16390</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-02-09T02:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: dll stdcall convention for vba</title>
      <link>https://community.intel.com/t5/Software-Archive/dll-stdcall-convention-for-vba/m-p/938267#M16391</link>
      <description>Ok - the answer is that to get the @4 you need to specify Project..Settings..Fortran..External Procedures..String length argument passing..After all args.  THEN the changes I suggested above will drop the hidden length argument.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Fri, 09 Feb 2001 02:49:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/dll-stdcall-convention-for-vba/m-p/938267#M16391</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-02-09T02:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: dll stdcall convention for vba</title>
      <link>https://community.intel.com/t5/Software-Archive/dll-stdcall-convention-for-vba/m-p/938268#M16392</link>
      <description>I used the above reference and changed to byval but I get a runtime error 453 cant find dll entry point. What do you think? &lt;BR /&gt; &lt;BR /&gt;I am still uncertain if the allias "_FCALLl_STRING@4" is correct?</description>
      <pubDate>Fri, 09 Feb 2001 03:02:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/dll-stdcall-convention-for-vba/m-p/938268#M16392</guid>
      <dc:creator>pecan204</dc:creator>
      <dc:date>2001-02-09T03:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: dll stdcall convention for vba</title>
      <link>https://community.intel.com/t5/Software-Archive/dll-stdcall-convention-for-vba/m-p/938269#M16393</link>
      <description>Steve, Made the changes and everything works now. Thanks!</description>
      <pubDate>Fri, 09 Feb 2001 03:04:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/dll-stdcall-convention-for-vba/m-p/938269#M16393</guid>
      <dc:creator>pecan204</dc:creator>
      <dc:date>2001-02-09T03:04:26Z</dc:date>
    </item>
  </channel>
</rss>

