LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

GetUserEvent Multithreading

Hello there,

i have a problem with the GetUserEvent function in my multithreading application.

The UI is executed by the main thread, which calls some measurement routines. These routines run in another thread to have the possibility to have a quick reaction of the panels in the UI. In the measurement routines a function is called, which checks if there is an user event in the UI with GetUserEvent. The problem is, that the GetUserEvent function hangs with no reaction by clicking on everything on the desired panel.

My apprehension is, that one thread can not call GetUserEvent for checking user events in another threads panels.

Is that correct?


Greetings from Germany,

Lars
0 Kudos
Message 1 of 2
(3,342 Views)
Hello Lars,
 
the thread, in which you call RunUserInterface will get all User Interface Events. So if you are starting a second thread, and call "GetUserEvent", the function will waitr forever, as all Events are passed to the main thread (in your case). What you could do is define a callback, that reacts on this user event. In this callback you could set a flag, and save the transmitted data to a variable. In your "measurement thread" you can then check the flag instead of "GetUSerEvent", and fetch the data in case of the flag is set.
 
Hope this helps!
André
 
0 Kudos
Message 2 of 2
(3,305 Views)