A COM component exposes an API which expects a ref param of object type. As per the documentation of this API, it will fill the ref object with array of values. Now my problem is in prod env I can't predict the number of elements which I will get back.
Following code will work.
COMClass objCOM = new COMClass ();
object colOfInts= new int[10]; // What if I don't know the following will return array of size 10?
int errorcode = objCOM.FillThisIn(ref colOfInts);
But what if I don't know the size of array that API returns in ref.
Update here
object colOfInts = null;
int errorcode = objCOM .FillThisIn(ref colOfInts);
now when I check the type I get System.Int32[*]
Basically I need to iterate through this array and check for the presence of an element