Appel d'un DLL fortran depuis vb 2008 express
bonjour,
J'ai cherche sur internet et sur le forum mais je n'ai pas trouve de reponse a mon probleme...
J'ai un programme vb qui appelle un DLL ecrit en fortran.
J'essai de comprendre le fonctionnement donc j'ai ecrit 2 codes simples.
voici mon code vb:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| Public Class Form1
Private Sub start_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles start.Click
Dim tab(15, 2) As Double
Dim i, b As Integer
Dim k As Double
For i = 1 To 15
tab(i, 0) = 0
tab(i, 0) = i
Next
tab(1, 0) = TextBox1.Text
tab(2, 0) = TextBox2.Text
tab(3, 0) = TextBox3.Text
tab(4, 0) = TextBox4.Text
tab(5, 0) = TextBox5.Text
tab(6, 0) = TextBox6.Text
tab(7, 0) = TextBox7.Text
tab(8, 0) = TextBox8.Text
tab(9, 0) = TextBox9.Text
tab(10, 0) = TextBox10.Text
tab(11, 0) = TextBox11.Text
tab(12, 0) = TextBox12.Text
tab(13, 0) = TextBox13.Text
tab(14, 0) = TextBox14.Text
tab(15, 0) = TextBox15.Text
b = tab(1, 0)
k = somme(b)
TextBox16.Text = k
Module revoi
Declare Function somme Lib "C:\test\beware.dll" (ByVal r As Integer) As Double
End Module
End Sub |
voila, j'ai un userform avec des textbox et les valeurs sont mises dans un tableau.
je prend une des valeur du tableau et je voudrais l'envoyer vers la fonction fortran dans un dll situe dans c:\test\
voici le code fortran:
Code:
1 2 3 4 5 6 7
| integer function somme(a)
integer::a
integer i
i=a*23
somme=i
return
end |
quand je lance le prog, il me dit exception.
Ou est mon erreur?
Merci