BILLDOWS
Joined: 22 Jul 2005 Posts: 86 Location: Swansea, UK
|
Posted: Sun Aug 28, 2016 12:05 pm Post subject: |
|
|
In 32 bit mode (32 bit fortran to a DLL) and 32 bit Excel (various versions) the following code works:
! PACK1210 - Packing 1200*1000 pallet with maximum number of real boxes a * b
!
F_stdcall function PACK1210(a, b)
! Packing Function
WINAPP
include <WINDOWS.INS>
REAL*8 , intent(in) :: a,b
REAL*8 PACK1210, rpacked
etc
and in the Excel (32) the function is declared and the new function PACK1210 returns the expected results
Declare Function PACK1210 Lib "MathFunc.dll" (a As Double, b As Double) As Double
In 64 bit I have left the fortran program unchanged (but compiled in 64 bit mode and used SLINK64 to create the DLL)
I know that changes are required to the Doubles in the Excel 64 declaraTion (LongLong or LongPtr?)
but all attempts have failed to get the PACK1210 declaration to accept input - selecting the new function and then providing a and b values causes Excel 64 to re-start itself.
Any ideas would be gratefully received.
Thanks, Bill |
|