I've searched on this topic and read the excellent document detailing how to construct a LV cluster to match a complex C struct type.
However, I can't figure out how to construct the data to pass to a dll function that expects a pointer to an array of structs as an input. I am using LV 8.5.
The C struct looks like this:
typedef struct {
char *DeviceName;
char *Manufacturer;
char *SerialNumber;
unsigned int VendorID;
unsigned int ProductID;
int InputReportLen;
int OutputReportLen;
int Interface;
int Collection;
} mdeviceList2;
DeviceName and Manufacturer have a max size of 50, while SerialNumber has a max size of 20.
And the function prototype looks like this:
extern "C" int _stdcall GetList(
unsigned int VendorID,
unsigned int ProductID,
char *Manufacturer,
char *SerialNum,
char *DeviceName,
mdeviceList2 *pList,
int nMaxDevices);
The problem I am having is how to create the *plist argument in LabVIEW.
The attached image shows how I'm calling it now. I am using standard WinAPI convention, because I get an error 1517 with C calling convention. I am using "Adapt to Type" for *plist with "Pointers to Handles" as the data format.
I'd appreciate any input, even if it's "you can't do that without writing a wrapper."
Thanks!