Re:求教,关于调用DLL中结构+数组的疑问
建议1.更改CLF中的calling conversion为 "C"
2.pInfo参数的data format由handles by value 更改为pointer to handles
毕竟手头没有卡,只能提供这些供参考
lucky!
Re:求教,关于调用DLL中结构+数组的疑问
LV中cluster的定义和C中的struct不太一样。LV在cluster的开头有4个字节存储cluster中有几个元素。array也带了4字节存储元素。(主要因为LV存储cluster不是连续内存块,所以要记录个数)
LabVIEW stores cluster elements of varying data types according to the cluster order. To set cluster order, right-click the cluster border and select Cluster Order from the shortcut menu. LabVIEW stores scalar data directly in the cluster. LabVIEW stores arrays, strings, and paths indirectly. The LabVIEW cluster stores a handle that points to the location in memory where the data is stored. Because of alignment constraints of certain platforms, a few bytes of padding might follow the dimension size so that the first element of the data is correctly aligned. If you write DLLs or CINs, some platforms have special requirements about how you align and pad memory.
所以最好将cluster用flatten to string转换为binary传入DLL 终于明白了
页:
[1]