- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page