LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to run CVI program from command line

Solved!
Go to solution

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.

 

 

0 Kudos
Message 1 of 4
(1,023 Views)
Solution
Accepted by topic author guybrush_threepwood

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



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 4
(1,020 Views)

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!

0 Kudos
Message 3 of 4
(1,013 Views)

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



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 4
(992 Views)