I have made a program in Fortran, compiled it as a dll and call it from Excel. That has worked fine for several years.
Recently I upgraded my Fortran compiler, and now I get the error Message "Bad DLL calling convention".
My old compiler was Compaq Visual Fortran Prof ed 6.6 a used from an early version of Microsoft Visual Studio.
My new compiler is Intel Visual Fortran used in Visual Studio 2010 Shell.
The two versions of Visual studio are almost identical to use. I have made a wery simple 1-file test project (one f90 file) and when I compile it on the old compiler it works, on the new one it doesent. I have testet both Excel 97 (under XP) and Excel 2010 under Win 7. The result is the same, the version of the dll made with the old compiler works, the new one does not.
Does anybody know if there is a trick with the new Fortran compiler that I am missing.
I have made a very simple project for testing. The Fortran code is simply:
The Excel code calling the dell looks like:
And in Module 1 I have declared:
Recently I upgraded my Fortran compiler, and now I get the error Message "Bad DLL calling convention".
My old compiler was Compaq Visual Fortran Prof ed 6.6 a used from an early version of Microsoft Visual Studio.
My new compiler is Intel Visual Fortran used in Visual Studio 2010 Shell.
The two versions of Visual studio are almost identical to use. I have made a wery simple 1-file test project (one f90 file) and when I compile it on the old compiler it works, on the new one it doesent. I have testet both Excel 97 (under XP) and Excel 2010 under Win 7. The result is the same, the version of the dll made with the old compiler works, the new one does not.
Does anybody know if there is a trick with the new Fortran compiler that I am missing.
I have made a very simple project for testing. The Fortran code is simply:
Code:
SubRoutine Demo(Number)
!DEC$ ATTRIBUTES DLLEXPORT, ALIAL : "Demo" :: Demo
Integer Number
Number=Number+5
End Subroutine Demo
The Excel code calling the dell looks like:
Code:
Private Sub CmdRun_Click() ' I have made a button
Number=7
Call Demo(Number)
MsgBox (Number)
End Sub
And in Module 1 I have declared:
Code:
Declare Sub Demo Lib "Demo.dll" (Number as Integer)