How do you pass an array of multiple data types to a COM object declared as [in, out] SAFEARRAY(VARIANT) in C# 4.0?
===

I'm looking for help passing an object with multiple datatypes to a COM object as defined below...

This is the COM object interface:

[id(0x00000004), helpstring("finds the next best item")]
        unsigned long GetNextItem([in, out] SAFEARRAY(VARIANT) Content);


This is the array that needs to be passed to the COM object.

    content[0][0] = 0.0 
    content[0][1] = 1   
    content[0][2] = 1   
    content[0][3] = 1      
    content[0][4] = -1  
    content[0][5] = 0.0 
    content[0][6] = 0.0

I have 2 issues:

1.  Creating an object in C# 4.0 that can contain multiple data types.
2.  Passing that object to the COM object through it's public interface.

This is the error I cannot get past:

SafeArrayTypeMismatchException{"Specified array was not of the expected type."}

Any help is appreciated!

Thanks,
Ken
 

