LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SAFEARRAY in Labview

I have seen questions like this before in this forum, but no solution. My question is how to make, pass a safearray into an activex method (IWebBrowwer for my part).

Thanks
0 Kudos
Message 1 of 4
(3,668 Views)
Solved the problem by using TCP/IP vi's and ordinary HTTP protocol commands. Would still like to know if it is possible to use safearreys in labview, and if so: how?
0 Kudos
Message 2 of 4
(3,668 Views)
Hi,
Extracting Information from a SAFEARRAY in LabVIEW:

There are two ways you could go about this.

The first would be to create a cluster with the same data types as a SAFEARRAY and use the Variant To Data for LabVIEW 6.x and To G Data for LabVIEW 5.x.

Here is the structure for a SAFEARRAY:

typedef struct tagSAFEARRAY
{
USHORT cDims;
USHORT fFeatures;
ULONG cbElements;
ULONG cLocks;
PVOID pvData;
SAFEARRAYBOUND rgsabound[ 1 ];
} SAFEARRAY;

So you could make a cluster with these same data types in it, in the same order. A USHORT is an unsigned short (U8), and ULONG is unsigned long (U32) and PVOID is a pointer to the data and SAFEARRAYBOUND is another cluster with this structure:

typedef struct tagSAFEARRAYBOUND
{
ULONG cElements;
LONG l
Lbound;
} SAFEARRAYBOUND;

A web page that describes all the different parameters is linked below.
MICROSOFT Support page: SAFEARRAY


The second is possibly the better/easier way to do this. You could write a wrapper DLL in C code that just passes out the array, which is all you really care about. That way you wouldn't need to worry about creating the cluster just right.

Good Luck
FerozP
Message 3 of 4
(3,668 Views)
Thanks, but this doesn't help much. The problem is the PVOID that point to the actual data. Besides, by making a DLL/C wrapper for an ActiveX object, then what's the idea of using ActiveX?
0 Kudos
Message 4 of 4
(3,668 Views)