Visit our LabVIEW Wiki Code Distribution Portal
Tags |
![]() |
Feb 24 2007, 11:26 AM
Post
#1
|
|||
![]() Confucius say: Crowded elevator always smell different to midget Admin ![]() Posts: 2402 Joined: 13-October 02 From: Planet Earth Member No.: 2 Using LabVIEW Since:1994 LV:8.5 ,8.2.1 ,7.1.1
My Blog
My Gallery
|
I was reading through a very thorough document here: File Handling Guidelines.
However it does not work for me. I keep getting the following dialog when I double-click a file: ![]() I've built the app in LV8.0 and I'm using the exe launcher trick. -------------------- Thank You
Michael Aivaliotis - Follow me on Twitter - My Personal Blog Search the LabVIEW Web - Build the LabVIEW Web - Got VIPM? ![]()
|
||
|
|
|||
| Ad |
Feb 24 2007, 11:26 AM
Post
#
|
||
|
|
|
||
|
|
|||
Feb 24 2007, 06:37 PM
Post
#2
|
|||
|
Drawing Tool - LVOOP example application Premium Member ![]() Posts: 1184 Joined: 29-January 06 From: Helsinki Member No.: 4014 Using LabVIEW Since:2004 LV:8.5.1 ,8.2.1 ,7.1.1
My Blog
|
Are you able to execute
"C:\Program Files\National Instruments\LabVIEW 8.2\labview.exe" "c:\path\to\myfile.lava" --------------------
|
||
|
|
|||
Feb 24 2007, 07:51 PM
Post
#3
|
|||
|
Changing the world, one VI at a time. JKI ![]() Posts: 1717 Joined: 22-October 02 From: San Francisco, CA Member No.: 17 Using LabVIEW Since:1995 LV:8.2.1 ,8.5 ,7.1.1
My Blog
My Gallery
|
I was reading through a very thorough document here: File Handling Guidelines. However it does not work for me. I keep getting the following dialog when I double-click a file: I've built the app in LV8.0 and I'm using the exe launcher trick. Post a copy of your windows registry so that it's easier to help you debug But seriously, some examples of your key/values would help. I'll bet you're just missing some quotes around your paths. --------------------
|
||
|
|
|||
Feb 24 2007, 08:20 PM
Post
#4
|
||||
![]() Confucius say: Crowded elevator always smell different to midget Admin ![]() Posts: 2402 Joined: 13-October 02 From: Planet Earth Member No.: 2 Using LabVIEW Since:1994 LV:8.5 ,8.2.1 ,7.1.1
My Blog
My Gallery
|
"C:\Program Files\National Instruments\LabVIEW 8.2\labview.exe" "c:\path\to\myfile.lava" some examples of your key/values would help. I'll bet you're just missing some quotes around your paths. ![]() ...and before you jump on it, I tried putting the "c:\hello.exe" in quotes as well but it didn't help. -------------------- Thank You
Michael Aivaliotis - Follow me on Twitter - My Personal Blog Search the LabVIEW Web - Build the LabVIEW Web - Got VIPM? ![]()
|
|||
|
|
||||
Feb 24 2007, 09:07 PM
Post
#5
|
|||
|
Changing the world, one VI at a time. JKI ![]() Posts: 1717 Joined: 22-October 02 From: San Francisco, CA Member No.: 17 Using LabVIEW Since:1995 LV:8.2.1 ,8.5 ,7.1.1
My Blog
My Gallery
|
...and before you jump on it, I tried putting the "c:hello.exe" in quotes as well but it didn't help. Hmmm, my guess is that customfile.lava is not a valid LabVIEW file (that's what the error message says). If you have a non-LabVIEW file that you want your exe stub to handle, you need to pass it as a user-defined command-line argument, according to LabVIEW conventions (pass it after the double hyphen "--"). QUOTE ("LabVIEW Help") Application:Command Line Arguments Property
Returns an array of user-defined command-line arguments passed when LabVIEW launched. User-defined arguments start after two hyphens (--) surrounded by spaces in the command line. The first string in the array is the name of the executable launched. This property does not return the name of the VI launched or the LLB that contains the VI. If a user-defined command-line argument contains double quotation marks ("), this property returns the argument without the quotation marks. If you use this property in a stand-alone application, you can pass all arguments as user-defined arguments so you do not need to enter the two hyphens before user-defined arguments in the command line. This property is similar to the Pass all command line arguments to application option on the Advanced page of the Application Properties dialog box. Example --------------------
|
||
|
|
|||
Feb 24 2007, 09:27 PM
Post
#6
|
|||
![]() Confucius say: Crowded elevator always smell different to midget Admin ![]() Posts: 2402 Joined: 13-October 02 From: Planet Earth Member No.: 2 Using LabVIEW Since:1994 LV:8.5 ,8.2.1 ,7.1.1
My Blog
My Gallery
|
Ok, thanks Jim
-------------------- Thank You
Michael Aivaliotis - Follow me on Twitter - My Personal Blog Search the LabVIEW Web - Build the LabVIEW Web - Got VIPM? ![]()
|
||
|
|
|||
Mar 3 2007, 11:46 AM
Post
#7
|
|||
![]() CCT It Premium Member ![]() Posts: 1393 Joined: 13-June 05 From: Woerden, Netherlands Member No.: 2399 Using LabVIEW Since:2001 LV:8.5.1 ,6.1 ,8.2.1
My Blog
My Gallery
|
I recently stumbled upon an application event that looks like this:
Application.OS Open Document, it is called when LabVIEW tries to open a non-LV document, ![]() I've tested it, and it works!!! One downside, the first call to the exe will result in an error of LabVIEW claiming it is a non-LV file, consequitive calls work great! Included a project (with exe) that shows the work. You have to register the tonfile.reg file, copy the exe into c:\tonfile, the open one of the two *.ton files, the first will show an error Ton
FileLoader.zip ( 41.2K )
Number of downloads: 126--------------------
|
||
|
|
|||
Mar 3 2007, 06:23 PM
Post
#8
|
|||
|
Changing the world, one VI at a time. JKI ![]() Posts: 1717 Joined: 22-October 02 From: San Francisco, CA Member No.: 17 Using LabVIEW Since:1995 LV:8.2.1 ,8.5 ,7.1.1
My Blog
My Gallery
|
I recently stumbled upon an application event that looks like this: Application.OS Open Document, it is called when LabVIEW tries to open a non-LV document, I've tested it, and it works!!! One downside, the first call to the exe will result in an error of LabVIEW claiming it is a non-LV file, consequitive calls work great! Included a project (with exe) that shows the work. You have to register the tonfile.reg file, copy the exe into c:\tonfile, the open one of the two *.ton files, the first will show an error Ton Ton, That's a great find! Does it work for files sent with DDE (after the App is already running)? I wonder if there is any way to suppress the error message. Thanks, [UPDATE 1] Yes, it works when the app is already running. Very cool! [UPDATE 2] I just figured out that the error message only appears when the application is passed the file path via the command-line argument (when app is first launched). The error does not occur when the files are sent via DDE. For example, if you launch the app manually and then double-click your files, there is no error message. [UPDATE 3] I figured out how to get everything to work. Use the following registry settings: (The double hypen "--" makes the file path a "user argument" and thus suppresses the error message. Setting the ddeexec = open(%1) makes the DDE work right.) CODE REGEDIT
HKEY_CLASSES_ROOT\.TON = tonfile HKEY_CLASSES_ROOT\tonfile = My Ton Files HKEY_CLASSES_ROOT\tonfile\shell\open\command = "d:\tonfile\application.exe" -- "%1" KEY_CLASSES_ROOT\tonfile\shell\open\ddeexec = open(%1) KEY_CLASSES_ROOT\tonfile\shell\open\ddeexec\Application = application KEY_CLASSES_ROOT\tonfile\shell\open\ddeexec\Topic = System
Attached File(s)
--------------------
|
||
|
|
|||
Mar 3 2007, 06:55 PM
Post
#9
|
|||
![]() CCT It Premium Member ![]() Posts: 1393 Joined: 13-June 05 From: Woerden, Netherlands Member No.: 2399 Using LabVIEW Since:2001 LV:8.5.1 ,6.1 ,8.2.1
My Blog
My Gallery
|
EDIT: see next post
This post has been edited by tcplomp: Mar 3 2007, 07:43 PM --------------------
|
||
|
|
|||
Mar 3 2007, 07:00 PM
Post
#10
|
|||
|
Changing the world, one VI at a time. JKI ![]() Posts: 1717 Joined: 22-October 02 From: San Francisco, CA Member No.: 17 Using LabVIEW Since:1995 LV:8.2.1 ,8.5 ,7.1.1
My Blog
My Gallery
|
Yes it is the DDE implementation, the bad thing is launching the program via the file-ref is not working, and the way to get that working (pass command line parameters) will break this method Ton See my 3rd update to my previous posting for a fully working solution Also, it's worth mentioning that this OS Open Document Application Event is exposed when you have the SuperSecretPrivateSpecialStuff=True setting in your LabVIEW.ini file. And, this feature first appeared in LabVIEW 8.2. --------------------
|
||
|
|
|||
Mar 3 2007, 07:26 PM
Post
#11
|
|
![]() CCT It Premium Member ![]() Posts: 1393 Joined: 13-June 05 From: Woerden, Netherlands Member No.: 2399 Using LabVIEW Since:2001 LV:8.5.1 ,6.1 ,8.2.1
My Blog
My Gallery
|
See my 3rd update to my previous posting for a fully working solution Allright, who is gonna buy who a beer I figured a little more out, setting the registry with this options: CODE HKEY_CLASSES_ROOT\tonfile\shell\open\command = "d:\tonfile\application.exe" HKEY_CLASSES_ROOT\tonfile\shell\open\ddeexec = open(%1) You don't need the command line arguments, windows will launch the program via command, and will set up a DDE connection with (open(%1)), and the event is triggered! Notice that the open\command does not include %1! The whole code is: ![]() Ton This post has been edited by tcplomp: Mar 3 2007, 07:27 PM -------------------- |