LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

uir file define with same id

Just start a new project with 2 panel in the same UIR.

As you can see in the picture, there is 2 different elements with the same ID in the same panel!

 

Obviously, this creates a problem when I try to modify object #2 (SW_PANEL_REFRESH_COM_LIST) since it has the same ID as object #1 (SW_PANEL)

How to fix that?

 

I try to remove them, recompile and put it back, but same thing!

0 Kudos
Message 1 of 3
(2,187 Views)

What type of errors are you finding and how are you addressing the objects?

The .h file you are showing appears to be generated automatically by CVI and has no errors inside: in your .uir file you have two panels (MAIN_PANEL, id=1; SW_PANEL, id=2) each of which has some controls on it, numbered from 2 onward.

When you load a panel in memory with LoadPanel you pass the id of a panel and receive back a panel handle; it's the only time you are actually using the panel ID: from that moment on it is no more used and control IDs are used instead in instructions like SetCtrlVal. Give this, having a panel and a control with the same ID generates no confusion.

Showing us your code and the errors you are getting in compilation/execution will help us to clarify the situation.



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 2 of 3
(2,162 Views)

@Goncalo: Short answer is: it doesn't matter.

 

The 2 of SW_PANEL is the ID of the PANEL, that holds the controls (it is the 2nd panel in the UIR),

the 2 of SW_PANEL_REFRESH_COM_LIST is the ID of the first CONTROL within the panel.

 

You use different functions to work with both so it is OK for them to have same value.

 

If you copy the SW_PANEL with all the controls in it you'll get a panel ID of 3 for the copy but the controls keep their ID from 2 onward. Just the defines change their name. That's why you have to give both panel and control if you have to work with controls.

-----------------------
/* Nothing past this point should fail if the code is working as intended */
0 Kudos
Message 3 of 3
(2,150 Views)