Jump to content

Open application and loading file


Recommended Posts

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"
Link to comment
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." :)

Link to comment
Yes thats it :) Thank you very much. Fantastic :thumbup:

Need to check off this option in the builder options for it to work:

post-3560-1160510293.png?width=400

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!)

Link to comment
  • 3 months later...

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?

Link to comment
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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.