NI LabVIEW,CVI,数据采集等产品讨论区

取消
显示结果 
搜索替代 
您的意思是: 

如何在不确定返回数组的大小情况下使用DLL?

已解决!
转到解答

调用DLL,返回一个数组,但是返回的数组大小并不能在调用DLL前确定返回的数组大小。

帮助中的例子都是在已经确定了返回数组大小的情况下,先开辟一个内存空间才能使用。

那对于不能确定返回数组大小的情况下,应该如何使用DLL?

0 项奖励
1 条消息(共 6 条)
5,156 次查看
解答
已被主题作者 chenyin 接受

在“Call DLL.vi"的Caution中有提到:If the size of the returning array cannot be known before the Call Library Function node, then use of the memory management functions found in the "Using External Code in LabVIEW" manual is recommended.  

 

下面是该manual的链接,供你参考:

https://download.ni.com/support/manuals/370109a.pdf

 

 

 

 

2 条消息(共 6 条)
5,145 次查看

thanks

正需要这个!

0 项奖励
3 条消息(共 6 条)
5,134 次查看
That's useful 🙂 Thanks!
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 项奖励
4 条消息(共 6 条)
5,117 次查看

DLL中调用 NumericArrayResize出错,按照的是NI网站的例子

我按照NI网站上说的
http://zone.ni.com/reference/en-XX/help/371361F-01/lvhowto/concatenating_two_strings/
但是VC编译总是不通过。。。编译的错误信息是
--------------------Configuration: MyDLLTest - Win32 Debug--------------------
Linking...
  Creating library Debug/MyDLLTest.lib and object Debug/MyDLLTest.exp
LINK : fatal error LNK1000: unknown error; consult documentation for technical support options
Error executing link.exe.

MyDLLTest.dll - 1 error(s), 0 warning(s)
VC的工程文件都在附件,请问如何才能通过编译。
之所以能确定 NumericArrayResize的问题,因为我如果将 NumericArrayResize注释起来,编译就可以通过。
PS: NumericArrayResize函数主要用在DLL中改变数组大小。
可否提供一个已经通过VC++6.0编译的例子,只要例子中包括了NumericArrayResize函数即可。。。
下来的我会自己研究,谢谢!
帖子被chenyin在 01-15-2010 08:16 AM

时编辑过了

0 项奖励
5 条消息(共 6 条)
5,103 次查看
不好意思,我这边没装VC,请有装VC的朋友帮忙看一下。
0 项奖励
6 条消息(共 6 条)
5,044 次查看