Jump to content

INI file for my application


Recommended Posts

Hi, I have confiuration file defaults.ini for my application. When I compile it and then run it, i see always the message : ["C:\MyApplication\MyApplication.exe\defaults.ini" not found]. I have tried to change in MyApplication Property - Advanced - Configuration file form LabView.ini to my file defaults.ini. But it still doesn't work :( Does someone have any idea where is the problem? (LabView 8.6)

Link to comment

QUOTE (pikro @ Sep 5 2008, 12:28 PM)

Hi, I have confiuration file defaults.ini file for my application. When I compile it and then run it. Every time i see message : "C:\MyApplication\MyApplication.exe\defaults.ini" not found. I have tried in MyApplication Property - Advanced - Change configuration file form LabView.ini to my file defaults.ini. But it still doesnt work :( Have some one idea where is the problem? (LabView 8.6)

When you get the path of a VI from within an EXE, the name of the EXE is treated as a folder. The EXE is basically just a glorified LLB.

You need to strip one extra level from the "this VI's Path" to get the containing folder after making an EXE. Pain in the rear I know, but once you know about it, you'll know in future.

Shane.

Link to comment

Et tu, Christian?

While that method is reasonably likely to work (at least in Windows), it fails to account for many corner cases (e.g. non-Windows OS, a VI in an LLB, a VI whose extension is .exe, etc.). A more robust way would be to do something like this:

Top_Level_Folder.png

Incidentally, this example has its own problems (the top level VI might not always be what you think), but the stripping part is sound.

Link to comment

QUOTE (Yair @ Sep 6 2008, 08:17 PM)

Thank you for help. This solution doesn´t work, but on your link i found similar way with case structure. And that work.

Link to comment

QUOTE (pikro @ Sep 9 2008, 10:43 AM)

This solution doesn´t work

That code works just fine. As I mentioned, the part on the left (getting the name of the top level VI) might not behave as you expect under all circumstances, but the loop was the important part of the code.

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.