graastein Posted October 10, 2006 Report Share Posted October 10, 2006 Is it possible to open an LabVIEW-made application and loading a file, by clicking a file. Like you open Word when clicking .doc file? It would then load the clicked file into the application. Is this possible? Quote Link to comment
Yair Posted October 10, 2006 Report Share Posted October 10, 2006 You should be able to associate the extension with your application through Windows Explorer (right click the file and select Open and then select your executable). I haven't done any detecting of the opened file like this, but this might help you. Each of my projects has its own labview.ini file. I've created different file extensions for each LabVIEW version (.lv7ini, .lv71ini,...) so that when I double click on the ini file the right version of LabVIEW is opened for the project. The action associated with the ini file is <labview version dir>\labview.exe -pref "%l" Quote Link to comment
graastein Posted October 10, 2006 Author Report Share Posted October 10, 2006 You should be able to associate the extension with your application through Windows Explorer (right click the file and select Open and then select your executable). I haven't done any detecting of the opened file like this, but this might help you. Thanks for your reply. Yes I know about this, but how does I then load the clicked file into my application? Usualy I use the file dialog for this. Should be an Event that was called: "If application is called by a file." Quote Link to comment
crelf Posted October 10, 2006 Report Share Posted October 10, 2006 Should be an Event that was called: "If application is called by a file." Is this what you want? 1 Quote Link to comment
graastein Posted October 10, 2006 Author Report Share Posted October 10, 2006 Yes thats it Thank you very much. Fantastic :thumbup: Need to check off this option in the builder options for it to work: Is it possible to automaticly register a filetype to an application when the application is installed? 1 Quote Link to comment
Yair Posted October 10, 2006 Report Share Posted October 10, 2006 You can check out this thread and the link at the end. I'm also pretty sure I saw a VI for doing this through the registry somewhere. Quote Link to comment
crelf Posted October 10, 2006 Report Share Posted October 10, 2006 Yes thats it Thank you very much. Fantastic :thumbup: Need to check off this option in the builder options for it to work: Oops - you're right - sorry that I forgot to mention that Is it possible to automaticly register a filetype to an application when the application is installed? Excellent question - the most "proper" method is described here. It includes some screwing around with the registry, but you can now do that with the LabVIEW application installer (yay! thanks NI!) Quote Link to comment
crelf Posted October 10, 2006 Report Share Posted October 10, 2006 You can check out this thread and the link at the end. I'm also pretty sure I saw a VI for doing this through the registry somewhere. Great link yen! Quote Link to comment
kai_n Posted February 3, 2007 Report Share Posted February 3, 2007 That really is a great link. But I got one more wish: If my application is already open and the user double-clicks a file assossiated with my application I want the file to be loaded automatically. I don`t want my application to be loaded a second time, I want to get the filepath and use it in the running application. Is there a solution for this? Quote Link to comment
Jim Kring Posted February 3, 2007 Report Share Posted February 3, 2007 That really is a great link.But I got one more wish: If my application is already open and the user double-clicks a file assossiated with my application I want the file to be loaded automatically. I don`t want my application to be loaded a second time, I want to get the filepath and use it in the running application. Is there a solution for this? Yes there is a solution. No, it's not easy. Generally, this is done in Windows via DDE. Unfortunately, LabVIEW's doesn't have VIs for doing this. You might want to look at this OpenG article for more info: OpenG: File Handling Guidelines 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.