LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I extract data from an OLE variant data?

I'm working with a COM server that sends the data with an OLE Variant type. I could see this in a variant indicator I attached to the output data of the invoke node function. The data in this indicator is :
Variant type ->VT_ARRAY|VT_UI1
Value ->Array ( Non displayable)
I use the 'Variant to Data' function to cast the data, but I don't know what type have to input to extract the data.The data I expect to see is this struct:
{
SAFEARRAY *parray;
long var1;
long var2;
LPBYTE pData;
}
I have tried to make a cluster with this struct but I receive a 'incorrect type' error (code=80020005h) in the 'Variant to Data' function. I have tried many combinations but without success. It was useful if someone gives me a exampl
e of how to extract data from an ole variant, specially if the real data contains pointers.
0 Kudos
Message 1 of 2
(2,403 Views)
AOrtin,
It seems to be an array of U8. Wire an array of U8 to the type input of Variant to Data function.


LabVIEW, C'est LabVIEW

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