Jump to content

Recommended Posts

Hi, I am working on a project for my university. My application has a couple configuration files that are constantly being changed. My file I/O seems to work perfectly until I build the application. It seems that after I build the application, it will not create any files and shows an error. It also appears to not read or even modify files. I have never used the application builder before. I have also attempted creating the build from a setup file to no avail. Do I need to change anything that has to do with permissions?

Mike

Link to comment

Hi Mike

I think you are trying to access a file relative to your main vi using the file constant "Current Vi's Path" and then striping it back one level to get the directory that your main vi resides and then building your file path from there. This is a problem when you build your application as the path that is returned by Current Vi's Path will be for example. C:\MyApp\MyApplication.exe\Main.vi

What you need to do is detect your application kind ie Runtime or Development and handle the path stripping appropriately. You will find more information on it here

and here

I hope this helps

Link to comment
  • 10 months later...

QUOTE(SciWare @ Apr 18 2006, 02:02 AM)

Thanks, that's better than what I was doing (I had been stripping in case of .exe, but I hadn't thought of .LLB).

On a related note, does anybody here use the EXIT.vi found here to close executables' windows on exit? I don't use it as written (I wrote a partial-copy instead) because it assumes that only the top-level VI should be causing an exit of the executable - I guess that might be good form, but I'd rather be flexible.

Link to comment

QUOTE(torekp @ Mar 9 2007, 03:40 PM)

I use it. Often, applications need to properly clean up after themselves (close communication references, etc.) and you can do that either by having a manager which will handle this and do garbage collection (usually too complicated and unnecessary) or handle it in the place which will handle the proper shutdown of the application, which would usually be the top-level VI.

You should note the explanation (which is probably the main use case) - this was done because full programs are occasionally called as subVIs and if they would be allowed to do this, the application would be terminated when the user ended the subVI call. Since this is not your case, it is probably less relevant for you. As Ton mentioned, you can simply use the VI with an extra input to decide what you want to do.

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
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.