12-07-2018 03:54 AM
I have this function:
DLL_EXPORT unsigned long OpenInt(void ** ppHandle, DeviceInfo * pDevice);
device info is defined as:
struct DeviceInfo { unsigned long c_port; unsigned long type; unsigned long device_ver1 unsigned long device_ver2; unsigned char device_serial[6]; };
My question is how can i configure call library function note for the function to work properly?
My Idea is to create cluster with 4 uint32s but how to pass char device_serial[6] to dll? Should I use array with 6 elements of a type uint8 ?
12-07-2018 04:38 AM
An array will pass a pointer to it, so that won't work. Same for a string.
I'd try (for the char[6]) a cluster with 6 bytes. So you'll have a cluster with 4 U32s and a cluster of 6 bytes.
You can also make a cluster with 6 U32s. The last two bytes of the last U32 won't be used, but won't hurt.
In fact, you could simply pass an array of bytes. 4X4+6=22 should do. LV will pass a pointer to the data, and the dll will be happy.