public static GetVARIANTs ( object values, bool preprocess ) : |
||
values | object | An array of the objects to be marshalled |
preprocess | bool | Whether the objects should have troublesome types removed before marhalling. |
return |
public static IntPtr GetVARIANTs(object[] values, bool preprocess)
{
int count = (values != null)?values.Length:0;
if (count <= 0)
{
return IntPtr.Zero;
}
IntPtr pValues = Marshal.AllocCoTaskMem(count*VARIANT_SIZE);
IntPtr pos = pValues;
for (int ii = 0; ii < count; ii++)
{
if (preprocess)
{
Marshal.GetNativeVariantForObject(GetVARIANT(values[ii]), pos);
}
else
{
Marshal.GetNativeVariantForObject(values[ii], pos);
}
pos = (IntPtr)(pos.ToInt64() + VARIANT_SIZE);
}
return pValues;
}
ComUtils::GetVARIANTs ( |