Michael Aivaliotis Posted February 25, 2007 Report Share Posted February 25, 2007 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. Quote Link to comment
Tomi Maila Posted February 25, 2007 Report Share Posted February 25, 2007 Are you able to execute "C:\Program Files\National Instruments\LabVIEW 8.2\labview.exe" "c:\path\to\myfile.lava" Quote Link to comment
Jim Kring Posted February 25, 2007 Report Share Posted February 25, 2007 QUOTE(Michael_Aivaliotis @ Feb 24 2007, 03:26 AM) I was reading through a very thorough document here: http://openg.org/tiki/tiki-index.php?page=File+Handling+Guidelines' target="_blank">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. Quote Link to comment
Michael Aivaliotis Posted February 25, 2007 Author Report Share Posted February 25, 2007 QUOTE(Tomi Maila @ Feb 24 2007, 10:37 AM) "C:\Program Files\National Instruments\LabVIEW 8.2\labview.exe" "c:\path\to\myfile.lava" QUOTE(Jim Kring @ Feb 24 2007, 11:51 AM) 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. Quote Link to comment
Jim Kring Posted February 25, 2007 Report Share Posted February 25, 2007 QUOTE(Michael_Aivaliotis @ Feb 24 2007, 12:20 PM) ...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 1 Quote Link to comment
Michael Aivaliotis Posted February 25, 2007 Author Report Share Posted February 25, 2007 Ok, thanks Jim :thumbup: . This all makes sense now. The original document I referenced is out of date at this point since several key elements are missing. I should of read the NI help. My problem was I did not have (--) and I did not even have the Builder flag set either. Both wrong. Quote Link to comment
Ton Plomp Posted March 4, 2007 Report Share Posted March 4, 2007 (edited) I recently stumbled upon an application event that looks like this: Application.OS Open Document, it is called when LV tries to open a non-LV document, (link removed) 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 , however clicking the file again will load the path into the VI Ton (link removed) Edited April 22, 2010 by crelf Irrepairable broken LAVA 1.0 links removed Quote Link to comment
Jim Kring Posted March 4, 2007 Report Share Posted March 4, 2007 QUOTE(tcplomp @ Mar 3 2007, 03:46 AM) I recently stumbled upon an application event that looks like this:Application.OS Open Document, it is called when LV 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 , however clicking the file again will load the path into the VI 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] Yes, it works when the app is already running. Very cool! :thumbup: Quote Link to comment
Ton Plomp Posted March 4, 2007 Report Share Posted March 4, 2007 QUOTE(Jim Kring @ Mar 3 2007, 07:23 PM) 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. 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 :thumbdown: Ton Quote Link to comment
Jim Kring Posted March 4, 2007 Report Share Posted March 4, 2007 QUOTE(tcplomp @ Mar 3 2007, 10:55 AM) 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 :thumbdown: Ton See my 3rd update to my previous posting for a fully working solution :thumbup: 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. Quote Link to comment
Ton Plomp Posted March 4, 2007 Report Share Posted March 4, 2007 <cite>QUOTE(Jim Kring @ Mar 3 2007, 08:00 PM) </a></cite> See my 3rd update to my previous posting for a fully working solution :thumbup: Allright, who is gonna buy who a beer :question: I figured a little more out, setting the registry with this options: 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: <a href='http://forums.lavag.org/index.php?act=attach&type=post&id=5110'>http://forums.lavag.org/index.php?act=attach&type=post&id=5110 Ton Quote Link to comment
Jim Kring Posted March 4, 2007 Report Share Posted March 4, 2007 QUOTE(tcplomp @ Mar 3 2007, 11:26 AM) Allright, who is gonna buy who a beer :question: I figured a little more out, setting the registry with this options: I think that Michael is going to need to buy us both beer Great work, Ton! Now we just need some nice VIs for setting these actions in the Windows Registry (so that we don't need to run .reg scripts)... Quote Link to comment
Michael Aivaliotis Posted March 4, 2007 Author Report Share Posted March 4, 2007 This is great! I already have a working solution and I am only using 8.0 but when I'm ready, I'll use it. Thanks. I hope NI doesn't remove this feature just because we discovered it. . That would be mean. Quote Link to comment
Irene_he Posted March 5, 2007 Report Share Posted March 5, 2007 Hi, aren't you guys (I mean Michael and Jim) suppose to sit side by side in an office? Or you like to broadcast your office conversation? But I think we don't mind to hear . Just curious Irene Quote Link to comment
Chris Davis Posted March 5, 2007 Report Share Posted March 5, 2007 QUOTE Or you like to broadcast your office conversation? I think they broadcast for the benefit of the community. If they hadn't broadcast this question, they wouldn't have come up with this answer. Either way, thanks for this thread and its information. I'll be using this method in the near future with an 8.2 project. Guess I'll have to turn on the SuperPrivateSecret(Captain)Stuff to see this event. Quote Link to comment
jpdrolet Posted March 5, 2007 Report Share Posted March 5, 2007 Ahh.... My pet problem with LabVIEW apps solved! I'll pay you beers guys. I have a VI to register file extensions. I'll make it available when I'll have access to it. Great find! Quote Link to comment
Irene_he Posted March 5, 2007 Report Share Posted March 5, 2007 I think they broadcast for the benefit of the community. ] I said we don't mind to listen!! Quote Link to comment
crelf Posted March 5, 2007 Report Share Posted March 5, 2007 QUOTE(Irene_he @ Mar 5 2007, 02:25 AM) ...we don't mind to listen!! They're LAVA exhibitionists, and we're LAVA voyeurs... Quote Link to comment
Jim Kring Posted March 5, 2007 Report Share Posted March 5, 2007 QUOTE(Irene_he @ Mar 3 2007, 09:57 PM) Hi, aren't you guys (I mean Michael and Jim) suppose to sit side by side in an office? Or you like to broadcast your office conversation? But I think we don't mind to listen . Just curious Irene, Yes, Michael and I chat all the time. However, making conversations visible on LAVA means that others get to participate and contribute. In this case, Ton discovered a beautiful gem and shared it with us. Maybe that wouldn't have happened if we hadn't taken our discussion public. I think it benefits everyone to have an open discourse. -Jim Quote Link to comment
Ton Plomp Posted March 5, 2007 Report Share Posted March 5, 2007 It is usefull to express your (inhouse) problems public, it'll trigger other people. I have the feeling I get some sort of sixth sense for forums, sometimes I read about a bug and stumble upon it the next day (happened twice to me....) I found the Application event friday, said i'd look into it into the weekend, and then remembered Michaels post (just a week old). Now another Application event (VI activation) is kinda buggy... if someone finds a way to make that one usefull, PM me! Ton Quote Link to comment
jpdrolet Posted April 26, 2007 Report Share Posted April 26, 2007 QUOTE(jpdrolet @ Mar 4 2007, 10:08 AM) Ahh.... My pet problem with LabVIEW apps solved! I'll pay you beers guys.I have a VI to register file extensions. I'll make it available when I'll have access to it. Great find! OK I thought I'd have time to modify it to use Registry VIs but here it uses regedit.exe. Quote Link to comment
nicolasB Posted October 10, 2007 Report Share Posted October 10, 2007 Hi at all, this looks very interesting but I tried to make this run under LV 8.5 and LV8.2.1 and it doesn't work. Even the "OS Open Document"-Event isn't available in these versions. Have you made the same experiences? Nicolas Quote Link to comment
Ton Plomp Posted October 10, 2007 Report Share Posted October 10, 2007 QUOTE(Jim Kring @ Mar 3 2007, 09:00 PM) 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. QUOTE(nicolasB @ Oct 9 2007, 01:48 PM) this looks very interesting but I tried to make this run under LV 8.5 and LV8.2.1 and it doesn't work. Even the "OS Open Document"-Event isn't available in these versions. I haven't tested it in 8.2 but I wouldn't think it has changed. (you can see it probably in VIPM but Michael should know that) Ton Quote Link to comment
silmaril Posted October 10, 2007 Report Share Posted October 10, 2007 QUOTE(nicolasB @ Oct 9 2007, 01:48 PM) this looks very interesting but I tried to make this run under LV 8.5 and LV8.2.1 and it doesn't work. Even the "OS Open Document"-Event isn't available in these versions. It's only available, if you have Scripting enabled. You need to have this in your labview.ini: SuperSecretPrivateSpecialStuff=True Please read this first, if you are new to this topic: http://forums.lavag.org/VI-Scripting-Readme-First-t1207.html' target="_blank">VI Scripting - Readme First Quote Link to comment
nicolasB Posted October 11, 2007 Report Share Posted October 11, 2007 QUOTE(silmaril @ Oct 9 2007, 02:23 PM) It's only available, if you have Scripting enabled. yes, that's it! Thanx Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.