My application (LabWindows/CVI) was originally developed to operate with controls on user panels. I now am modifying it to continue to operate the same, along with operating from a host interface by responding to commands. My approach for this is to start a thread that simply scans the interface for incoming commands, then activate the appropriate control's callback in the main program. This works great for simple 'do-and-return-rightaway' functions, but there are a couple that do not return from the Callback for some time, and during this time the code in the interface handler hangs until the Callback returns.
I need to be able to have the interface handler initiate a trigger to the main program, without actually calling the Callback function. I tried to use the QueueUserEvent(...) function, hoping that RunUserInterface(...) would respond as if the panel control had been activated, but it didn't. My next thought is to replace my RunUserInterface(...) call with a loop that does the same thing, and that includes a GetUserEvent(...) call that I could then call the Callback function with the results of. If this doesn't work, my last recourse would be to rewrite most of the main program to operate completely different; something that I neither want to do nor believe is necessary.
What code does the RunUserInterface(...) method contain?