LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to map labview data to a dll whose input is a struct consisting of a handle and pointer to a value?

This is the problem that i am facing. I have read the manuals and the application notes but none of these offer me any solution.
I built my dll in c++ environment.The function is as follow
DllSpec SHORT APIENTRY acqcomp12(P12ID*brd,BYRTE rw).So when i call this function into labview i have to map the value in labview data, however i do not know how to map a input that is a struct.

Below is the struct declaration,
typedef struct
{
HANDLE Brdhandle;
P12SWR*SWRpointer;
}P12ID,*PP12ID;

Also what is a handle, can i simply map it as an unsigned integer 32bits in labview envirnment.
0 Kudos
Message 1 of 2
(2,353 Views)
The easiest way to do this is to just create a wrapper function; that is, you create a function that passes and receives simple data types from labview and then places them in the necessary structure so that you can call the dll function you want. You can sometimes pass odd data types as variants or using the adapt to type, but these both pass the data as pointers and handles, not as values. A handle is basicly a pointer to a pointer. It represents a place in memory. Even if your program allowed you to pass it as an integer, you would have trouble using it effectively this way.
0 Kudos
Message 2 of 2
(2,353 Views)