LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to embed .uir into .lib under CVI 7.0

How could I embed .uir files into static library (.lib) under CVI 7.0?
0 Kudos
Message 1 of 4
(3,636 Views)
Hi,

A .lib or .obj file contain only compiled object code. The only way that you can include the UIR in an object file is by converting the uir file to code. Under the CVI tools menu you can access the UI to code converter utility that will create a c and h file with functions that you cal to load the panels. The only difference is that your UIR is being created programmatically, so you don't require the uir file.

By creating the UI at run-time the code can be part of the object file. Make sure that you keep a backup of your UIR file; you can't go back from code to UIR.

Please give this a try and let me know how this goes.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 2 of 4
(3,636 Views)
I was hoping that I could do it with this new option to embed uir files in executables. The method you suggested is very incovinient if I need to change the panel later, and it will be very difficult to keep uir panel always in sync with the source code. At which point in the executable build process the .uir gets embedded into the executable?

Thank you,

konstantin
0 Kudos
Message 3 of 4
(3,636 Views)
This happens at link time. The problem is that while DLLs and EXEs have resource sections where items such as .uir files can be stored, LIB files do not. So you cannot embed anything in a .lib file. Now, if the application that uses the .lib file is itself a CVI dll or executable, you can add the .uir to that project, along with the .lib file, and then select this option. Otherwise, you'll have to follow the suggestion that Juan Carlos gave.

Luis
NI
0 Kudos
Message 4 of 4
(3,636 Views)