CVF and VB.net

CVF and VB.net

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.
Example:

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

In VB.net 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 / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

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.

Steve

Steve - Intel Developer Support

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).

Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!