Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Below code contains the fortran77 dll call from vb.net with two-dimensional array and struture.Input Parameters are flg & a_in(,),it calculates some value and inturn it

populates the output array in a_pn(,) and a_vOUT(,).There is a addressof callback function used in fortran dll.I couldn't able to fetch the output values to proceed

further.Waiting for your kind reply ASAP.

---VB.Net Code with Fortran dll call---

Dim flg As Int32 Dim a_in(,) As Double --- Input array with values Dim a_PN(,) as Double ----Output array return from Fortran77 DLL (Value calculated from a_in(,) array

and returns) Dim a_vOUT(,) as Double ----Output array return from Fortran77 DLL Dim a_Flgs(,) as Int32 Dim a_b() as byte Dim a_string1 As New VB6.FixedLengthString

(255)

Public Structure Case_Info Dim nx() As Double Dim ny() As Double Dim tc() As Double Dim ip(,) As Double End Structure

W_Ftrn(Flg, a_in(1, 1), a_PN(1, 1),a_vOUT(1, 1), a_Flgs(1, 1), .TC(1), .ip(1, 1),.nx(1), .ny(1), AddressOf CallBack0, AddressOf CallBack1, a_b(1), a_string1.Value, 255)

---Fortran declaration in vb.net--

Public Declare Sub W_Ftrn _ Lib "D:\Proj2\Fortran.DLL" Alias "W_Ftrn" _ (ByRef flg As integer,ByRef a_in As Double, ByRef a_PN As Double, ByRef a_vOUT As Double, ByRef

a_Flgs As Int32, _ ByRef constray As Double, ByRef ipn As Double, _ ByRef aGX%, ByRef aGY#, _ ByVal cbaddr0 As long,ByVal cbaddr1 As long,ByRef bPlain As Byte, _

ByVal s1 As String, ByRef L1 As Int32)
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900