Question

I'm programming an application in javascript which uses activeX object.
The ActiveX function gets a VARIANT parameter from javascript call.

If I define a global variable named *V1 and compare it to the get variable, like this:

V1 = &variant;

It doesn't work because the data lost after function ends.
How can I clone the variant safely and easily?

Was it helpful?

Solution

Use VariantCopy function (link)

VARIANT v1;
VariantCopy(&v1, &variant);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top