LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

General protection fault with alt-tabbing and pop ups

Hi,

 

This is probably a case of me doing something I shouldn't, but I figured out a while ago that I could get resizable modal pop ups by doing something like this:

 

SetPanelAttribute(panelHandle2, ATTR_SIZABLE, 0);
InstallPopup(panelHandle2);
SetPanelAttribute(panelHandle2, ATTR_SIZABLE, 1);

This is almost certainly a hack, but it seems to work and I get modal pop ups that the user can resize and maximize.  However, the run-time engine does not seem to like this, and I am getting general protection faults when alt-tabbing between the main application window and the pop up (which both have taskbar buttons).  The address where it crashes, at least on my computer, is 0x684F5E34 which is in cvirte.dll.  This also seems to crash in the release configuation.

 

I've attached a small sample application.  In order to see the problem, launch the application, open the Pop Up, and alt-tab a few times between the two windows.  On my development PC this will generate a general protection fault after a few times (often the first time).  I'm running CVI 2012SP1 on a Windows XP Pro PC.

 

Any insight would be helpful.  Thanks.

 

 

0 Kudos
Message 1 of 3
(3,630 Views)

What I don't understand is how you can switch between main and popup panel since the latter is displayed with InstallPopup: I never succeed in getting focus to the main panel when the popup is active, and it is not even listed among windows in alt-tab procedure. If I select the main window in taskbar, the popup immediately comes up and gets the focus.



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,625 Views)

It also crashes with CVI2013, the difference is in the address (different RTE), in my case I have 0x684F2A66

 

@Roberto: You do not need to tab yourself - simply set a few breakpoints so that CVI will switch windows...

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