CVF and

CVF and

I am trying to pass a string array from VB.Net to Fortran CVF DLL.
I can do it with no problem in VB6 but because of a change in VB.Net
I can seem to get it to work because VB.Net does not allow the
definition of a string to have a length.

In VB6
type stringarray
dim mystring(9) as string * 80
end type

In as far as I can tell, you CAN'T define a length.

type stringarray
dim mystring(9) as string
end type

Also, how do I pass structures with a string in it?
Is there a difference between passing a structure and
a class instance?

Thank in advance for any help!

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

Public FirstName As String
Public LastName As String
Public Title As String
Public ReviewComments As String

The above show you how to declare fixed length strings in Visual Basic.Net

I recently added this example of VB.NET calling CVF to the CVF web site, though it doesn't cover arrays or structures. There are discussions of VB arrays in past issues of the CVF newsletter, and, I think, in the Programmer's Guide chapter on mixed-language programming.


Retired 12/31/2016

I found out that you have to declare your dll as Ansi.
I had a programmer who declared it as "Auto" and it
gave me every other charcter in my Fortran DLL because
it assumed it was unicode data.

Ansi Optional. Converts all strings to ANSI values. If no modifier is specified, Ansi is the default.

Unicode Optional. Converts all strings to Unicode values.

Auto Optional. Converts the strings according to common language runtime rules based on the name of the method (or the alias name, if specified).

Leave a Comment

Please sign in to add a comment. Not a member? Join today