LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

posting an event to the event queue ?

Solved!
Go to solution

i am searching for a way to post an event onto the event queue.

 

i found the QueueUserEvent() function but seems to only works in conjunction with GetUserEvent(). i don't want another queue, i want to post the event into the same queue than all the user interface. is there any way of achieving this ?

 

or maybe someone knows a way to trigger the EVENT_COMMIT or EVENT_VAL_CHANGED of a string control after programmatically changing the value of the control ?

0 Kudos
Message 1 of 3
(3,221 Views)
Solution
Accepted by topic author dummy_decoy

You could use CallCtrlCallback () immediately after programmatic change of control value. If the immediate calling of this function within the same routine that updates the control is not correct, you could define a special function for update to call with PostDeferredCall (), which is executed after the calling function terminates.

 

(Well, really you could simply call the control callback passing the appropriate values: it's a little rude but not forbidden. CallCtrlCallback preserves the callback chaining of the control, in case you have used it)

Message Edited by Roberto Bozzolo on 12-12-2008 04:43 PM


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
(3,220 Views)

indeed, CallCtrlCallback() works. i was not aware of this function. (i also discovered callback chaining, i should see if it would not help solve my problem too...)

 

i am not fond of directly calling the callback. i'd rather post a new message, this let terminate the current iteration of the message loop and process any pending message before processing the posted message. also, calling callback functions directly can lead to a serious deadlock when 2 controls wants to update each other, while posting messages would allow the software to continue its normal execution flow. i think such a call is missing in the User Interface Library...

 

thanks anyway for the answer.

 

 

0 Kudos
Message 3 of 3
(3,213 Views)