#28 Get******ArgumentValue in managedArgumentList.cpp

open
nobody
None
5
2011-09-05
2011-09-05
Mark Owen
No

The method MyArray^ GetArrayArgumentValue(String^ ArgumentName) in managedArgumentList.cpp has a bug:
Information is being destroyed when passing an xlw::MyArray object, and then casting it to IntPtr((void*)& etc. The information contained in the array is destroyed. Here's the fix:

MyArray^ GetArrayArgumentValue(String^ ArgumentName)
{
xlw::MyArray arrayArgumentValue = theInner->GetArrayArgumentValue(CLR2CPP(ArgumentName));
MyArray^ result = gcnew MyArray(IntPtr((void*)&arrayArgumentValue));
// MyArray^ result = gcnew MyArray(IntPtr((void*)&theInner->GetArrayArgumentValue(CLR2CPP(ArgumentName))));
return gcnew MyArray(result);
}

The same bug probably needs to be corrected in the methods GetMatrixArgumentValue, GetCellsArgumentValue and GetArgumentListArgumentValue.

Discussion

  • John Adcock
    John Adcock
    2011-09-05

    Thanks again for this report, bug confirmed and fix will be in next alpha release.