Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29276 Discussions

calling cvf6.6 dll from visual basic net

gjb
Beginner
520 Views
I am having problems calling cvf from visual basic net. I can pass strings and integers but cannot pass single arrays.

I am trying to pass an array x defined as single (i.e. Dim x(20) as single). I set x in the fortran subroutine in VB as (Byref x as single, Byval N as integer) (I have tried byref and byval) where N is the number of values to pass. In the call statement I pass x as x(1)and N since this was the way to do it with VB 6 and CVF (pass the first value).

In the fortran dll it receives the values as x and N and x is dimensioned as a real x(N). This worked with VB 6 but doesn't with VB7.

How can I pass arrays back and forth between CVF and VB7?

This doesn't work and gives me an "Object reference not set to an instance of the Object" error.
0 Kudos
1 Reply
gjb
Beginner
520 Views
Never mind, sorted it out. Just like call from VB6 except all integers and singles need to be passed by reference. Sending byval screwed things up. Thought it was the array, but it was all integers and singles.
0 Kudos
Reply