I have an vb.net executable that calls a c++/clr dll (that in turn calls a native c++ dll). I need to pass arrays between all three. In vb.net I use the following:
Dim arrsize = 10
Dim array(arrsize,arrsize) as Double
then I pass this to c++/clr code
result = vbcalltocppcode(array)
and in c++/clr code (inside a public ref classthat i create an instance of in vb.net)
bool vbcalltocppcode(array<double,2>^ clrarray)
If I try to extract the length of this using
size_t cpparrsize = clrarray->GetLength(1);
cpparrsize = 11. Why is this? Is there any overhead that I don't see or what?
(the reason for this is that when I try to populate this in the native c++ code with arrays of rank 2 and 3, assuming in native c++ that the array is one dimensional I loose some values, i.e. some values are put in clrarray[*,11] which I do not want.)
Of course I could solve this just skipping what I believe to be the 11th index but since I am not sure this seems a bit hazardous.