Click to See Complete Forum and Search --> : Help: Passing matrix from vb.net to c++ dll


heidrus
June 27th, 2007, 01:03 PM
Hi Everyone :)

here is my question...

I've to pass a matrix ( consistinf of double(,) ) from vb.net to a c++ dll. I've tried to write something, however I keep gettin PInvoke or Marshalling errors, where the issue is the access to memory...

Herebelow I'm reporting an extract of what I wrote...

VB.NET
.....
Declare Function Pluto Lib "mytest.dll" (ByVal matrice As Double(,)) as integer
.....

private sub DataToMyTest
dim valore as integer
dim matrice as double(,) = new double(2,2){}
.... code to populate the matrix ....
valore = Pluto(matrice)
end sub

C++
.....
extern "C" __declspec(dllexport) int Pluto (double **matrice)
{
... code....
return 0
}

Thanks for your support :)
Heidrus