call DLL with IMSL too many time causing crashing

call DLL with IMSL too many time causing crashing

Hi,
I am trying to call DLL file, which includes IMSL, from Visual Basic to perform a simulation.
However, when I call this DLL too many times, the whole program crashes(disappear). Is this a memory leak problem? What can I do? Any suggestions will be welcome. Thanks in advance.

1.Fortran codes: test.f90
subroutine betarnd(y,a,b,m)
use numerical_libraries
!DEC$ ATTRIBUTES DLLEXPORT, ALIAS : "betarnd" :: betarnd
double precision :: y(m),a,b
call drnbet(m,a,b,y)
return
end subroutine betarnd

2. DF /dll test.f90
3. VB codes
Declare Sub betarnd Lib "test.dll" (ByRef Y As Double, a As Double, b As Double, m As Long)

cayugafisher

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.