07-04-2022 06:28 AM
Hi! For memory debugging purposes, I need to start my program from the command line. I know what my current working directory should be. I go there in the command prompt and run >myprogram.exe. The result is an error in call to LoadAnsiPanel (File not found: myprogram.uir, Error code -94).
Why can't LoadPanelAnsi find the file even though the cwd is the same? The same happens if I start the .exe file from the file explorer.
Solved! Go to Solution.
07-04-2022 06:47 AM
Two options:
1. Unless stated otherwise in LoadPanel, .UIR files must be located in application folder: is thefilepresent where the application expects to find it?
2. In Build >> Target Settings mark "Embed Project .UIRs" checkbox: this way .UIR files are no longer needed as informations on the panels and controls are included in the executable
07-04-2022 07:04 AM
Thanks for answering!
1. It is located at "../" (adjusted for in the code), but that shouldn't be the problem since I make sure that I use the same working directory as when I run the program via the CVI IDE, right?
2. Solved my problem! Thanks!
07-04-2022 08:08 AM - edited 07-04-2022 08:09 AM
@guybrush_threepwood ha scritto:
Thanks for answering!
1. It is located at "../" (adjusted for in the code), but that shouldn't be the problem since I make sure that I use the same working directory as when I run the program via the CVI IDE, right?
I really don't know, I never tried putting .UIRs in a directory other than the application one.
But I see in the help for the function:
You can use a complete pathname or a simple filename for filename. If the name is a simple filename that contains no directory path, the file is loaded from the directory that contains the executable. |
Now I don't know how to interpret this sentence, as this does not mention a relative pathname. I wonder for example if relative pathnames are to be intended with reference to the application folder or to the working directoy.
Anyway, l'm gladto heve helpedyou.