I'm trying to pass .NET array to COM VB6 library. I have an object which is COM wrapper of VB6 object. It has method with the following signature:
[MethodImpl(MethodImplOptions.InternalCall,
MethodCodeType = MethodCodeType.Runtime)]
void AddEx([MarshalAs(UnmanagedType.Struct)] object vSafeArrayOfItems);
but when I call it I get an ArgumentException
with the following message:
Value does not fall within the expected range.
The type of exception and its description doesn't even depend on passed element.
Does anybody know how to go around this issue?
UPD: I removed .NET wrapper assemblies and referrenced source .COM libraries. No changes had happened.