LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

My application seems to randomly lose focus?

Hi,

 

I have a CVI application that uses an ActiveX control to display a PDF file on a panel.  I created navigation buttons to allow a user to view the next / previous PDF file in a series.  The names of the PDF files included in the series are read from a configuration file so that the PDF file library content can be tailored for a particular need.

 

The app is working pretty well except that when I select my 'NEXT' navigation button to display the next PDF file in the series, it works 2, maybe 3, sometimes 4, but rarely 5 times in a row until my project quits executing the command button callback events.  It seems random on how many times it might work before this happens.  I found that if I click somewhere off my app panel, I can then come back to my app and click my 'NEXT' button and will work again for a few more tries and then hang again.

 

Note: my app has a timer and its events continue to run when the problem occurs, so based on forum searches, I've attempted to put 'SetForegroundWindow'() and 'MakeApplicationActive'() calls into the timer callback but I still can't get my app to retain focus.  This behavior really has me baffled.

 

Any ideas?  Thanks!

 

Tim

0 Kudos
Message 1 of 2
(2,140 Views)

I have similar to exact behavior.  Anything further on this?

I've inherited an old Test Executive project which has a subordinate panel that allows operators to input serial numbers.  Processing the "Done" button will process a database pull of information associated with the serial numbers.  Upon returning, the pull-down menu may or may not work.  Clicking off-screen and then back will permit the drop down to display the expected options.

I've tried various MakeApplicationActive, SetActivePanel, etc...

It appears that the callback associated with the panel isn't being called.

 

Any advice would be appreciated.

P.

0 Kudos
Message 2 of 2
(1,567 Views)