I have a COM function that expects object[] as a parameter:
foo(object[] values)
I want to pass some enum fields to it so I use the following:
object[] fields = (object[])Enum.GetValues(typeof(SomeEnumType));
However, when I try to pass fields to foo(...) i.e. [foo(fields)] I get an error:
"Unable to cast object of type `SomeEnumType[]' to type 'system.Object[]'.
Can anyone tell me what I'm doing wrong?