! These subroutines are necessary because DLL_IMPORT cannot used in the module. ! Acts as an interface between the Form and the Win32 DLL. subroutine GetScalarData ( Int4input,Int4output,& Real4input,Real4output,& Char5input,Char10output,& DTinput,DToutput) implicit none ! Unmanaged (Win32 native) DLL procedure explicit interfaces. interface subroutine Int4 (IvarIn,Ivar) integer, intent (in) :: IvarIn integer, intent (out) :: Ivar end subroutine Int4 subroutine Real4 (RvarIn,Rvar) real, intent (in) :: RvarIn real, intent (out) :: Rvar end subroutine Real4 subroutine Char1 (CvarIn,Cvar) character (len=5), intent (in) :: CvarIn character (len=10), intent (out) :: Cvar end subroutine Char1 subroutine DTpass (DTIvarIn,DTRvarIn,DTCvarIn,DTIvar,DTRvar,DTCvar) integer, intent (in) :: DTIvarIn real, intent (in) :: DTRvarIn character(len=10), intent (in) :: DTCvarIn integer, intent (out) :: DTIvar real, intent (out) :: DTRvar character(len=10), intent (out) :: DTCvar end subroutine DTpass end interface dll_import("DynamicLibrary1") :: Int4,Real4,Char1,DTpass ! variable declarations integer, intent (in) :: Int4input integer, intent (out) :: Int4output real, intent (in) :: Real4input real, intent (out) :: Real4output character (len=5), intent (in) :: Char5input character (len=10), intent (out) :: Char10output type DT1 sequence integer :: Int4 real :: Real4 character(len=10) :: Char10 end type DT1 type(DT1) :: DTinput,DToutput ! Call the DLL procedures. call Int4(Int4input,Int4output) call Real4(Real4input,Real4output) call Char1(Char5input,Char10output) call DTpass(DTinput%Int4,DTinput%Real4,DTinput%Char10,DToutput%Int4,DToutput%Real4,DToutput%Char10) end subroutine GetScalarData subroutine GetArrayData (CharDim2input,CharDim2output) implicit none ! Unmanaged (Win32 native) DLL procedure explicit interfaces. interface subroutine CharArrayDim2 (CarrIn,Carr) character, dimension(2,3), intent (in) :: CarrIn character, dimension(3,2), intent (out) :: Carr end subroutine CharArrayDim2 end interface dll_import("DynamicLibrary1") :: CharArrayDim2 ! variable declarations character, dimension(2,3), intent (in) :: CharDim2input character, dimension(3,2), intent (out) :: CharDim2output ! Call the DLL procedure. call CharArrayDim2(CharDim2input,CharDim2output) end subroutine GetArrayData