gurteen
asked on
is there a way to have something tell me what type the items in the collection are?
Hello-
I have a vendor supplied DLL that I have been using with VB6, and am now switching over to C#.
It seems like what used to be a "Variant" in VB6 now loosely translates to "System.Object" (maybe?)
object rindexTypes; //1
System.Array myArray; //2
rindexTypes = _pfSet.get_SettingsFactorL ist(BarraA DT.FactorT ypes.aegFA CTOR_RISKI NDEX); //3
myArray = (System.Array)rindexTypes; //4
System.Console.WriteLine(m yArray.Get UpperBound (0)); //5 returns 12
I have muddled my way through to create this code above, and am concluding that line 3 returns type "System.Object", but that I can convert it to an array, and it has length 12. I would really like to inspect the actual objects contained, but don't know how to use the foreach, when I don't know
what object type I am working with! Any ideas?
I have a vendor supplied DLL that I have been using with VB6, and am now switching over to C#.
It seems like what used to be a "Variant" in VB6 now loosely translates to "System.Object" (maybe?)
object rindexTypes; //1
System.Array myArray; //2
rindexTypes = _pfSet.get_SettingsFactorL
myArray = (System.Array)rindexTypes;
System.Console.WriteLine(m
I have muddled my way through to create this code above, and am concluding that line 3 returns type "System.Object", but that I can convert it to an array, and it has length 12. I would really like to inspect the actual objects contained, but don't know how to use the foreach, when I don't know
what object type I am working with! Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
c:\Dowd\NET\PortWorkbench\