LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Fonction CA_VariantChar ne retourne pas un char

 

 

Bonjour

 

Je souhaite ecrir un char dans une case d'excel.

 

 char NumeroCertificat[20] = "CERTIFICAT"; 

 toto = CA_VariantChar (*NumeroCertificat);

 Excel_SetProperty (ExcelRangeHandle, &ErrorInfo, Excel_RangeValue2, CAVT_VARIANT, toto); 

 

Pour cela, j'utilise la fonction " Excel_SetProperty " à laquelle on doit passer un Variant

Je converti danc mon char ( ici : toto ) en Variant avec la fonction "CA_VariantChar"

 

Probleme : cette fonctionne ne semble pas me retourner un varant du type char, mais une valeur ( ici : 67 ... )

 

Merci de votre aide

Cdlt

Jerome

0 Kudos
Message 1 of 2
(2,799 Views)

Hi,

 

Thanks for posting on NI froum.

 

If you want to post on the english forum, you must speak in english for all others users of the comunity.

 

For your problem, I think CA_VariantChar change only one character, maybe you could use CA_VariantSetCString to convert a string to a variant.

Another possible problem is the " * " in CA_VariantChar parameter.

 

Regards,

Nicolas M.
National Instruments France


Journées Techniques LabVIEW 2012 : du 27 septembre au 22 novembre
2 sessions en parallèle : Débuter avec LabVIEW - Développer avec LabVIEW

0 Kudos
Message 2 of 2
(2,788 Views)