<?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 EXCEL DLL CALLING ARGUMENT PROBLEM in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/EXCEL-DLL-CALLING-ARGUMENT-PROBLEM/m-p/814459#M44533</link>
    <description>Joel,&lt;BR /&gt;&lt;BR /&gt;Here are some resourcesto help&lt;BR /&gt;&lt;BR /&gt;an article on: &lt;A href="http://software.intel.com/en-us/articles/migrating-from-compaq-visual-fortran/"&gt;converting from CVF to IVF &lt;/A&gt;and also an example that calls a Fortran DLL from Visual Basic instaled on your system at:&lt;BR /&gt;&lt;BR /&gt;&lt;INSTALL-DIR&gt;\Samples\C:\Users\wadoerne\Documents\MixedLanguage\VB-Calls-Fortran&lt;BR /&gt;&lt;BR /&gt;I would suggest looking at the article and seeing that some interface checking is different with our compiler. You could try to remove -warn-interfaces to see if that helps. &lt;BR /&gt;&lt;BR /&gt;If not can you give us the error message.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;------&lt;/P&gt;&lt;P&gt;Wendy&lt;/P&gt;&lt;P&gt;&lt;A href="http://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/announcement/241/"&gt;Attaching or including files in a post&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/INSTALL-DIR&gt;</description>
    <pubDate>Tue, 11 Oct 2011 23:20:22 GMT</pubDate>
    <dc:creator>Wendy_Doerner__Intel</dc:creator>
    <dc:date>2011-10-11T23:20:22Z</dc:date>
    <item>
      <title>EXCEL DLL CALLING ARGUMENT PROBLEM</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/EXCEL-DLL-CALLING-ARGUMENT-PROBLEM/m-p/814458#M44532</link>
      <description>I have two dll's. Both originally written with CVF 6.6 and converted to Intel Visual FORTRAN 11.1.&lt;BR /&gt;One of these works fine. I recompiled the second one recently and put it in use and it gets an error with passing the calling arguments. I compile it with CVG 6.6 and it works fine. I compile it with IVF and it will not work. I tried eliminating all but one calling argument and I cannot get it to work. I tried a string as the variable, I tried an Integer (both sizes), and I tried a REAL variable, and it would not work. If I remove all variables in the call it works fine.&lt;BR /&gt;&lt;BR /&gt;I took the project that works and copied that entire folder to a new folder, then deleted all of the FORTRAN routines, then added the second projects FORTRAN routines (attempting to use a "good working" project file), then added the programs to the project and rebuild my DLL. It did not work.&lt;BR /&gt;&lt;BR /&gt;***** Here is the DECLARE STATEMENT in my EXCEL module ******&lt;BR /&gt;Private Declare Sub DRAWMDLL Lib "H:\\Microsoft Visual Studio\\MyProjects\\Copy of Dealem2000\\Release_Intel_DLL\\DrawmDLL.DLL" (BigArray As Double, ByVal LngArraySize As Long, ByVal StrInputPath As String, ByVal LngLength1 As Long, ByVal StrOutputPath As String, ByVal LngLength2 As Long, ByVal StrParametersFileIn As String, ByVal LngLength2 As Long, ByVal StrForecastFileIn As String, ByVal LngLength2 As Long, ByVal StrMonRandomFileIn As String, ByVal LngLength3 As Long, ByVal StrDayRandomFileIn As String, ByVal LngLength4 As Long, ByVal StrAnnRandomFileOut As String, ByVal LngLength5 As Long, ByVal StrMonRandomFileOut As String, ByVal LngLength6 As Long, ByVal StrDayRandomFileOut As String, ByVal LngLength7 As Long, ByVal StrRMFileOut As String, ByVal LngLength8 As Long, ByVal StrVersion As String, ByVal LngLength9 As Long)&lt;BR /&gt;&lt;BR /&gt;***** Here is the CALL STATEMENT in my EXCEL module ******&lt;BR /&gt;Call DRAWMDLL(BigArray(0), LngArraySize, StrInputPath, LngLength1, StrOutputPath, LngLength2, StrParametersPathIn, LngLength3, StrForecastPathIn, LngLength3, StrMonRandomFileIn, LngLength3, StrDayRandomFileIn, LngLength4, StrAnnRandomFileOut, LngLength5, StrMonRandomFileOut, LngLength6, StrDayRandomFileOut, LngLength7, StrRMFileOut, LngLength8, StrVersion, LngLength9)&lt;BR /&gt;&lt;BR /&gt;I thought that I had compiled this project in IVF (in the past) and that it ran, but cannot verify that, so it is possible that this project has never worked with IVF.&lt;BR /&gt;&lt;BR /&gt;Any suggestions/help is appreciated.&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Oct 2011 19:06:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/EXCEL-DLL-CALLING-ARGUMENT-PROBLEM/m-p/814458#M44532</guid>
      <dc:creator>jlgilber</dc:creator>
      <dc:date>2011-10-11T19:06:27Z</dc:date>
    </item>
    <item>
      <title>EXCEL DLL CALLING ARGUMENT PROBLEM</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/EXCEL-DLL-CALLING-ARGUMENT-PROBLEM/m-p/814459#M44533</link>
      <description>Joel,&lt;BR /&gt;&lt;BR /&gt;Here are some resourcesto help&lt;BR /&gt;&lt;BR /&gt;an article on: &lt;A href="http://software.intel.com/en-us/articles/migrating-from-compaq-visual-fortran/"&gt;converting from CVF to IVF &lt;/A&gt;and also an example that calls a Fortran DLL from Visual Basic instaled on your system at:&lt;BR /&gt;&lt;BR /&gt;&lt;INSTALL-DIR&gt;\Samples\C:\Users\wadoerne\Documents\MixedLanguage\VB-Calls-Fortran&lt;BR /&gt;&lt;BR /&gt;I would suggest looking at the article and seeing that some interface checking is different with our compiler. You could try to remove -warn-interfaces to see if that helps. &lt;BR /&gt;&lt;BR /&gt;If not can you give us the error message.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;------&lt;/P&gt;&lt;P&gt;Wendy&lt;/P&gt;&lt;P&gt;&lt;A href="http://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/announcement/241/"&gt;Attaching or including files in a post&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/INSTALL-DIR&gt;</description>
      <pubDate>Tue, 11 Oct 2011 23:20:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/EXCEL-DLL-CALLING-ARGUMENT-PROBLEM/m-p/814459#M44533</guid>
      <dc:creator>Wendy_Doerner__Intel</dc:creator>
      <dc:date>2011-10-11T23:20:22Z</dc:date>
    </item>
    <item>
      <title>EXCEL DLL CALLING ARGUMENT PROBLEM</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/EXCEL-DLL-CALLING-ARGUMENT-PROBLEM/m-p/814460#M44534</link>
      <description>You may find this &lt;A href="http://software.intel.com/en-us/forums/showthread.php?t=76174"&gt;thread&lt;/A&gt; useful.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;David&lt;BR /&gt;</description>
      <pubDate>Wed, 12 Oct 2011 07:33:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/EXCEL-DLL-CALLING-ARGUMENT-PROBLEM/m-p/814460#M44534</guid>
      <dc:creator>DavidWhite</dc:creator>
      <dc:date>2011-10-12T07:33:44Z</dc:date>
    </item>
    <item>
      <title>EXCEL DLL CALLING ARGUMENT PROBLEM</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/EXCEL-DLL-CALLING-ARGUMENT-PROBLEM/m-p/814461#M44535</link>
      <description>I have tried as many options as I can think of with trying to pass even one argumnet with no success. The error message that I get is &lt;BR /&gt;&lt;BR /&gt;Run-time error '49':&lt;BR /&gt;Bad DLL calling convention&lt;BR /&gt;&lt;BR /&gt;Are there project settings that affect the calling argumnets other that the "DATA" sizes?</description>
      <pubDate>Thu, 13 Oct 2011 14:55:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/EXCEL-DLL-CALLING-ARGUMENT-PROBLEM/m-p/814461#M44535</guid>
      <dc:creator>jlgilber</dc:creator>
      <dc:date>2011-10-13T14:55:10Z</dc:date>
    </item>
    <item>
      <title>EXCEL DLL CALLING ARGUMENT PROBLEM</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/EXCEL-DLL-CALLING-ARGUMENT-PROBLEM/m-p/814462#M44536</link>
      <description>There are two calling conventions: cdecl and stdcall.&lt;BR /&gt;&lt;BR /&gt;stdcall is the old convention used by default by CVF (and it typically results in internal&lt;BR /&gt;names like &lt;A href="mailto:MYROUTINE@8"&gt;MYROUTINE@8&lt;/A&gt;. &lt;BR /&gt;&lt;BR /&gt;cdecl is the current standard (IIUIC) and that is used by default by Intel Fortran. This&lt;BR /&gt;leads to internal names like "MYROUTINE" - without the @8 (the number of &lt;BR /&gt;bytes expected in the argument list).&lt;BR /&gt;&lt;BR /&gt;The difference is in the way the stack is cleaned up - by the caller or the callee. So if you&lt;BR /&gt;get the convention wrong (i.e. the caller expects convention A and your DLL uses convention B),&lt;BR /&gt;then the stack is corrupted. &lt;BR /&gt;&lt;BR /&gt;My guess is that that is what is going wrong. You should experiment with the compiler options for IVF&lt;BR /&gt;to see if that makes a useful difference. I can not recommend any settings a priori, as I do not &lt;BR /&gt;know enough of your system.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Arjen&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Oct 2011 15:01:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/EXCEL-DLL-CALLING-ARGUMENT-PROBLEM/m-p/814462#M44536</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2011-10-13T15:01:52Z</dc:date>
    </item>
    <item>
      <title>EXCEL DLL CALLING ARGUMENT PROBLEM</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/EXCEL-DLL-CALLING-ARGUMENT-PROBLEM/m-p/814463#M44537</link>
      <description>Yes.&lt;BR /&gt;&lt;BR /&gt;You've shown us the VB declaration and call, which is only half of the story. Show us the Fortran side of things (the subroutine statement, the declarations for all the arguments, any compiler directives in the source code, etc) as well as letting us know the compile options that you are using. Otherwise we are all just guessing.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Oct 2011 20:29:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/EXCEL-DLL-CALLING-ARGUMENT-PROBLEM/m-p/814463#M44537</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2011-10-13T20:29:03Z</dc:date>
    </item>
    <item>
      <title>EXCEL DLL CALLING ARGUMENT PROBLEM</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/EXCEL-DLL-CALLING-ARGUMENT-PROBLEM/m-p/814464#M44538</link>
      <description>The compiler option "stdcall" was the key. I went to my "working" project and I had a statement for the "stdcall" option in that routine along with the "!dec attributes" as follows:&lt;BR /&gt;&lt;P&gt;&lt;BR /&gt;!dec$ attributes dllexport :: DrawmDLL !This exports the name&lt;/P&gt;&lt;P&gt;!dec$ attributes alias : "DRAWMDLL" :: DrawmDLL !This sets the name&lt;/P&gt;&lt;P&gt;!dec$ attributes stdcall, REFERENCE :: DrawmDLL &lt;BR /&gt;!dec$ attributes MIXED_STR_LEN_ARG :: DrawmDLL &lt;BR /&gt;&lt;BR /&gt;Thanks for everyones input.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2011 18:45:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/EXCEL-DLL-CALLING-ARGUMENT-PROBLEM/m-p/814464#M44538</guid>
      <dc:creator>jlgilber</dc:creator>
      <dc:date>2011-10-14T18:45:40Z</dc:date>
    </item>
  </channel>
</rss>

