<Runtime.InteropServices.DllImport("maDLL.dll")> _ Private Shared Function Ouvrir(ByRef tab_patch() As patch) As Integer End Function Public tab_patch(144) As patch Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Ouvrir(tab_patch(0)) MessageBox.Show(tab_patch(10).xc, "Test", MessageBoxButtons.OK, MessageBoxIcon.None) End Sub
struct patch { int xc, yc, w, h; double r, g, b; }; int Ouvrir(struct patch * tab_p) { tab_p[0].yc = 69; tab_p[10].xc=15; return 1; }
<Runtime.InteropServices.DllImport("maDLL.dll")> _ Private Shared Function Ouvrir(ByVal toto() As patch) As Integer End Function Public toto(144) As patch Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load MsgBox(Ouvrir(toto)) End Sub
struct patch { int xc, yc, w, h; double r, g, b; }; int Ouvrir(struct patch * tab_p) { tab_p[0].yc = 69; //juste pour tester une ecriture tab_p[10].xc=15; return tab_p[10].xc; // et une lecture... }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim xc, yc, w, h As Integerne signifie pas que chaque élément sera dimensionné en Integer.
Dim xc As Integer, yc As Integer, w As Integer, h As Integer