I have a COM object written in Visual Fox Pro 9.0. It has the following procedure:
PROCEDURE GetArray(m.vcArrayName as String) as array
RETURN @&vcArrayName
The COM object is referenced in a VS2010 project using C#. The signature of the procedure in C# is:
object GetArray(string vcArrayName);
When debugging I can see that the returned value is {object[1..1]} while the type is object {object[]}. Expanding the variable, I can see that it is an array of base 1 with one element which is an empty string ("");
However, I can not cast this value to object[]. I always get an InvalidCastException with a Norwegian message saying that I can't cast Object[*] to Object[].
A strange thing is that if the COM object returns a two dimensional array I have no problem casting it to object[,]. I find it very strange that two dimensions are easier to deal with than one!
The question I'd like answered is:
What is this Object[*] business? Can anybody tell me if it is a bad translation in the Norwegian exception message or if Object[*] is some kind of obscure C# syntax that I haven't heard of?