LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Variant in cluster

Hi,
I want to pass to a function of my DLL a cluster with two fields : an integer and a variant.
The parameter of the function is declare as "Adapt to Type -> Handle by value".
But I have a problem with the variant : I don't know how the variant is passed in the cluster to my fonction.
Here is the declaration of the cluster by LabVIEW :
typedef struct {
    int32 Numeric;
    PStr Variant;
    } TD1;
why the variant is defined as PStr ?

any ideas ?
thanks
Franck

0 Kudos
Message 1 of 4
(2,893 Views)
It's most likely defined as string becuuse it's the lowest common denominator.  You can convert everything to string.

Do you really need to send both elements of the cluster seperately?  Can't you just send the cluster as "adapt to type"?

Please bear in mind, I'm not an expert in LabVIEW DLL programming, so what I'm posting may be incorrect.....

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 2 of 4
(2,891 Views)
Thanks for your response.
I must use a cluster for my function. But my only problem now is to convert this string into a variant. I don't find any informations to help me to decode this string.


0 Kudos
Message 3 of 4
(2,887 Views)
Try the function "Unflatten from string".

I would guess that the variant has simply been flattened.  Unflattening it should get your variant back.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 4 of 4
(2,875 Views)