LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to call C++ dll function with "&variable"(not a pointer) parameter

Dears

I'm trying to call a C++ dll, the function has parameters defined as following header:

CGyroscopeDetect(OUT float& x, OUT float& y, OUT float& z, OUT float& value);

In VS2012, it can be called by following code:

float yyy[4] = {0.0};
CGyroscopeDetect(yyy[0], yyy[1], yyy[2], yyy[3])t

But I can not make it by LabVIEW dll call, although changed differenct kinds call parameter settings, anyone know that?thanks a lot.

 

WD

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

AFAIK, yyy[4] means "pointer to the 5th element" (not the girl from the movie). You should be able to simply index the fifth Element, and use that as input. The call library node should have it's input as pointer to value. That's the only way LabVIEW can have a parameter as input\output (pointers and\or handlers).

 

BTW, a pointer is not a reference, but both will mostly be compiled to the same code. However, a programmer can do arithmetic on a pointer, and that's not allowed with a reference. That makes pointers usually more dangerous. As far as LV goes, I'd consider them the same.

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