I am in front of a subtleties related to a transfer an integers array from a c++ com automation assembly to a vb.net winform application.
the array is defined in vb.net winform and the values are intialized inside the ole automation method. When the method returns to the main application to display the contents of the array, the defined values are lost. Something goes wrong in the heap it seems.
I have tried via a reference of the type library or late binding the effect is the same.
Here is the segment of the code I am trying to cover:
Private _Layer As Object = Nothing
Dim ArrValues(10) As Integer
BOOL CLayer::Generate(long FAR* IntegersArray, long Items)
for (long Index = 0; Index < Items; Index++)
IntegersArray[Index] = Index + 1;
The complete sample application is available from the following link: arraybounding
What could be the reason of my issue.
Thank you very much in advance.