Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 usage with Fortran DLL : size problem ?

Status
Not open for further replies.

flamandier

Programmer
Sep 25, 2009
7
FR
Hi,

I face in my application serious size problems.
I tried to isolate the problem, but I still don't get the explanation.

Here is the VB6 part :
----------------------
Type TY_VB6_Doubles
double1 As Double
End Type

Type TY_VB6_Test
testdoubles() As TYDoubles
End Type

Public Declare Sub performcalc Lib "calc.dll" (tyvb6test as TY_VB6_Test)

Subroutine DOCalc()
Dim tyvb6test as TY_VB6_Test
..
redim tyvb6test.testdoubles(1 TO 2800)
performcalc tyvb6test
...
end sub

Here is the FORTRAN part:
------------------------
Type TY_For_Doubles
Real*8 double1
End Type
Type Ty_For_Test
Type(TY_For_Doubles) testdoubles(2800)
End Type

Subroutine performcalc (inputvar)
!DEC$ ATTRIBUTES DLLEXPORT, STDCALL :: performcalc
!DEC$ ATTRIBUTES REFERENCE :: inputvar
Include '.\DataModel.typ'
Record /Ty_For_Test/ inputvar
Record /Ty_For_Test/ AnotherVar
.....
inputvar= AnotherVar
.....
end

Problem:
-------
I get an access violation (0X0000005) in VB thread on the line "inputvar = AnotherVar"
It means the copy was no successful.
But if I decrease 2800 to 2700, it works......

Is there any size restriction on input parameters to a Fortran DLL that I miss there ?


thanks



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top