titi_nicolas wrote:
The "File Dialog" Express VI does not do the job properly if we want to browse and select a folder *only*. It is still possible to select a file and click Open... which throw an pop-up window at the user face (with a stupid error message btw).
Hi nicolas,
I agree - it seems silly for the dialog to show files - and complain - after specifying "Folder Only" - but there's a simple workaround - just supply an unlikely file-pattern, like "!.!" - then files won't be displayed (so can't be selected!)
I was confused by your original post because you said "The DLL function uses a Cluster of pointers". The DLL may want a data-type that represents a collection of pointers, but the right name for that datatype isn't a "Cluster". The right name will be determined by the language the DLL was compiled in - usually "C"/C++ which means the DLL function uses a "structure", or an array. (Yes, LabVIEW can build DLLs, but then there couldn't be a Cluster of pointers.)
There may be a more elegant way, but the way I build structures for DLLs is to "pack" an array with bytes in the order required by the DLL/structure. The tricky part here is: LabVIEW doesn't have pointers - so how can you pass the string's address? I don't know the trick to get the address of (pointer to) a string - but I wouldn't give up. Maybe there's some User32 function - or .NET function that can be exploited for this. Worst case, if your have a compiler handy, you could build a DLL to accept a "cstr" parameter and pass the address back as a U32. Again, if you go down this road, make sure to zero-terminate the string! And, all this is assuming you're not writing to the string, if so then you'll need to pre-allocate the string-buffer's max-size in LabVIEW.
Cheers!
"Inside every large program is a small program struggling to get out." (attributed to
Tony Hoare)