LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ActiveX, One Button Dialog Won't Disappear

I have a VI that leads users through the calibration of an Omicron Bode 100. It uses OLE (basically ActiveX) controls to communicate with the device. My problem is the One Button Dialog popups that lead the user on to the next step won't disappear after clicking OK. Is this something to do with ActiveX? I had to set the VI Execution to User Interface because these particular ActiveX controls throw an error otherwise saying they need to run in a "Single-Threaded Apartment". Any ideas as to how to get the dialog box to disappear after clicking OK??? And why this is happening?? I'm stumped.
 
Michael
0 Kudos
Message 1 of 5
(2,811 Views)
What if you put a small wait statement between the completion of the dialog box and before the execution of the ActiveX object.  Give the CPU a few milliseconds to clean up the screen.  I'm thinking that since the activeX is executing in the UI thread, and it's happening immediately after the dialog box is okayed, the CPU cycles are eaten up the the ActiveX object and not allowing the CPU to redraw the screen.  Kind of like what happens in fast running while loops when there is no wait statement.  The mouse will stutter because the CPU is starved of cycles to take care of screen updates.
Message 2 of 5
(2,798 Views)
Aha, that did it. A simple delay of 0.5 secs made it disappear. Thanks.
0 Kudos
Message 3 of 5
(2,771 Views)
That's good to hear.  You may event want to try reducing the wait by a bit.  Try 250 ms.  Then 100 ms.  Probably no benefit going smaller than that.  It should make the system react a little faster in starting the next step, but still have plenty of time for the OS to clean up the screen.
Message 4 of 5
(2,758 Views)
Yah, I took it down to 100ms, still working fine. Thanks.
0 Kudos
Message 5 of 5
(2,756 Views)