LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Query of �UI to code converter�

In my application , the panel is loaded by �panel = LoadPanel (0, "myapp.uir", MPANEL);� ,If using �UI to code converter� tool to convert the uir file , I�d like to know if I need to modify the loading panel function ?

David
0 Kudos
Message 1 of 7
(3,889 Views)
The UI to Code Converter will generate a function for each panel in your UIR file. Call that new function instead of calling LoadPanel.
For example, if you have a panel with a constant name PANEL, the UI to Code Conveter will create a function BuildPANEL:
int BuildPANEL (int hParentPanel);
#include the .h file created by the UI to Code Converter in your .c file where you load the panels, then call the new function.

For example, replace

if ((panelHandle = LoadPanel (0, "embedded_ui.uir", PANEL)) < 0)

with

if ((panelHandle = BuildPANEL(0)) < 0)

Here's some help from the UI to Code Converter:
"The functions return an object handle or standard UI error code, and take a parent object handle as an input. The use of the functions is identical to that of LoadPa
nel and LoadMenubar, with the exception that you do not specify a *.UIR file or constant name."

When you use the UI to Code Converter, in the Output Target section, specify new Header File and Source File names.
0 Kudos
Message 2 of 7
(3,889 Views)
One of the reasons to use the ui to code converter is so that you don't have to worry about the .uir file when you move the executable. If that is the only reason you want to use it, there is a new feature in cvi 7.0 that allows you to embed the .uir file in the executable. You don't have to change your LoadPanel call (other than to make sure the .uir file path is not absolute).
0 Kudos
Message 3 of 7
(3,889 Views)
Hi,

The embed UI with executable option in the target settings it's a great option; just remember that the menu bars will have to be linked statically to the panel; this is going to the panel properties and assigning the menu bar there istead of uding LoadMenuBar().

Good luck,

Juan Carlos
N.I.
0 Kudos
Message 4 of 7
(3,891 Views)

I ASK FOR EXCUSE FOR MY BAD ENGLISH

 
I need a example code ,of how to call a menubar using a ui to code converter?,

Because I can not make it work

 

thanks

 

axel

0 Kudos
Message 5 of 7
(3,770 Views)

You also need to remember that (at least in CVI 7.0) the embedded UIR filename must not contain spaces.

JR

0 Kudos
Message 6 of 7
(3,754 Views)

When use the ui to code converter

replace

if (InitCVIRTE (0, argv, 0) == 0)                            
        return -1;                                               

 if ((hpanel = LoadPanel (0, "xx.uir", )) < 0)  

 for this expresion

if (InitCVIRTE (0, argv, 0) == 0)                          

        return -1;

   if ((hpanel  = BuildPANEL(0)) < 0)

    return -1;    

but have problems to invoke a menubars with (switch-case sentence)

how do for use a menu bar in embebed uir?

axel

 

0 Kudos
Message 7 of 7
(3,742 Views)