Board index » delphi » passing array of variants as a parameter

passing array of variants as a parameter

Hello,

I need to pass array of Variants to COM Object method.

How I can do this?

There is a VarArrayCreate function, but it creates Variant, not OleVariant.

Thank you in advance.

Regards,
Eugene.

 

Re:passing array of variants as a parameter


Eugene,

VarArrayCreate (as like all other Varxxx functions) fully suport
OLEVariants.

var
    v: OleVariant;
    v1, v2: OleVariant;

v := VarArrayCreate([0, 2], varVariant);

v [0] := v1;
v [1] := v2;

Should be what you need.  You can thus pass v when ever the parameter to the
function requires a Variant.

HTH

Nick.
Eugene V. Goldberg <eg...@sandy.ru> wrote in message
news:7rls35$qt45@forums.borland.com...

Quote
> Hello,

> I need to pass array of Variants to COM Object method.

> How I can do this?

> There is a VarArrayCreate function, but it creates Variant, not
OleVariant.

> Thank you in advance.

> Regards,
> Eugene.

Other Threads