From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to define function from dll that uses pointer to pointer parameters

Solved!
Go to solution

I have dll with function that is defined in header file like this:

 

DLL_EXPORT unsigned long openInterface(void ** ppHandle, unsigned long param1,

unsigned long param2, const char * param3, const char * param4Out);

When I try to import function using "Import Shared Library" I get red "i" next to parameter ppHandle, like in the attached image. The parameter ppHandle is defined as pointer to pointer with ** and I cannot figure out how can I define this function in Labview.

One additional information about void **ppHandle parameter is that this is "Pointer to pointer to object - handle. "

 

Please for help.

 

 

0 Kudos
Message 1 of 2
(2,003 Views)
Solution
Accepted by topic author Skoda3

If you don't need to do anything with that handle but passing it to other functions then you would configure this as a Numeric: pointer sized (unsigned) integer, passed with pointer to value. In the front panel of your VIs you would use a 64-bit (unsigned) integer control to pass this handle from VI to VI.

 

Other functions most likely will declare this parameter as:

 

function(void * pHandle, ....)

and here you would configure it as Numeric: pointer sized (unsigned) integer, passed as value.

 


@Skoda3

One additional information about void **ppHandle parameter is that this is "Pointer to pointer to object - handle. "

Nitpick. It is a reference to an opaque pointer, which might be an object, not a reference/pointer to a pointer to an object! The fact that it is an opaque pointer normally means that the caller should not know nor want to know what the actual implementation behind that handle is.

Rolf Kalbermatter
My Blog
Message 2 of 2
(1,970 Views)