自动识别打包后的软件路径 - 风定云远 - cpubbs论坛免费虚拟仪器博客 labview虚拟仪器讨论区 - cpubbs论坛 虚拟仪器论坛|labview论坛|labwindows论坛|vi|cvi|数据采集卡|入门教程|初学|软件下载|虚拟仪器免费博客|虚拟仪器电子商务|虚拟仪器商城|虚拟仪器人才中心|图形化单片机编程cpuview|虚拟仪器在线商城 - Powered by X-Space
明媚的阳关和微风,让我们感觉到了生活的美好.体验生活,体验美好! 请与我联系:wdyjz@126.com; QQ:787053185; MSN:wdyjz@126.com 网上店铺:http://www.cpubbs.com/market/show_shop.php?shopid=11

自动识别打包后的软件路径

上一篇 / 下一篇  2007-03-26 18:14:17 / 个人分类:wdy1

自动识别打包后的软件路径

摘自NI的一篇极好的文章!(打包后程序找不到辅助文件的解决方法)

Why Can't My Executable Load My Included File When I Use Relative Path Encoding?

Primary Software: LabVIEW Development Systems Primary Software Version: 6.1 Primary Software Fixed Version: N/A Secondary Software: Problem: I have created an application in LabVIEW that either creates or reads from an external file. I am using relative path encoding by using the Current VI's Path function in the Functions Palette » File I/O subpalette. My program runs in the development environment and is able to successfully perform file I/O. However, when I build my application into an executable using Application Builder, I receive an error indicating that either the file cannot be found, or the path is invalid. Solution: Notice that when you use the Current VI's Path function in the development environment, it will return to you the path in which the VI is located as well as the name of the VI. Often, the Strip Path function is then used to remove this portion of the path, and then the path is used elsewhere in the program. When the program is now built into an executable, the name of the executable now becomes part of the path, in addition to the VI's name. For example, if a VI named "Application.vi" is saved in C:\Program Files\Application, the Current VI's Path function would return C:\Program Files\Application\Application.vi when run in the development environment. Now, if the VI is built into an executable with a name of "App.exe" and saved in the same directory location, the Current VI's Path function will return C:\Program Files\Application\App.exe\Application.vi. In this case, you will need to use the Strip Path function twice to strip both "Application.vi" and "App.exe" from the path to retrieve the directory in which the executable is located.

TAG: wdy1

引用 删除 miaoqin   /   2011-03-30 09:08:36
5
引用 删除 haozhy9   /   2010-10-28 23:38:23
5
引用 删除 haozhy9   /   2010-10-28 23:38:21
终于找到问题所在 ~谢谢楼主~你写的东西真的很有帮助~受益匪浅~以后常来~
 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

Open Toolbar