LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert VARIANT to char (String)

Hello,
 
i will convert a String out a VARIANT from an AxtiveX-Objekt into a Char[256].
The value in the VARIANT is "234566;123321;344343;995867;".
That a funktion need i to do this.
 
 
Thanks
 
 
0 Kudos
Message 1 of 2
(6,068 Views)

From CVI's  ActiveX library:

 

Converts the BSTR string in the variant you specify into a dynamically allocated C-style string.

On success, CA_VariantGetCString releases the contents of the variant and marks it as empty.

CA_VariantGetCString returns an error if the variant does not contain a BSTR value.

When you no longer need the C-style string, call CA_FreeMemory to free it.


Prototype

HRESULT CA_VariantGetCString (VARIANT *Variant, char **Value);

Message 2 of 2
(6,065 Views)