LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

SetCtrlVal not updating control


RH640 ha scritto:

Actually, I did check the result of SetCtrlVal at one point and it returned zero which I think is success.


PANEL is a macro that evaluates to an integer, the same datatype as the panel handle. If by chance PANEL macro and panelHandle variable evaluate to the same value your program will work without problems and you won't get any error. Nevertheless, as far as the application grows and more panel are added to the UIR file and loaded in memory the possibility that those values match will become less probable and you are likely to get any sort of error while addressing controls.



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 11 of 12
(1,580 Views)

Wolfgang ha scritto:

Smiley Happy I also have a side note (related to Roberto's comment): whereas you check your function calls DisplayPanel () and RunUserInterface () for errors, you don't do so with SetCtrlVal (); you should and probably it will tell what Roberto already mentioned Smiley Happy


As an addition to your side note, checking return value of RunUserInterface with errChk macro is not necessarily correct: RunUserInterface does not return an error code, it returs the value passed to QuitUserInterface instead.



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 12 of 12
(1,579 Views)