LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Debug General Protection Fault in RunUserInterface()

Using CVI 8.0, I am getting a General Protection Fault in the RunUserInterface() command.  It doesn't happen right away, but after I use the program a bit.  I have checked things with full debugging within CVI but nothing is out of place.  I have been using CVI since 3.1 and I don't think I have had this happen before.  I have backtracked my recent changes but the crash seems to be here to stay.

0 Kudos
Message 1 of 5
(4,787 Views)
Hello Mande,

In order to help debug this problem, were you able to isolate which part of the code causes the error.  Is there a sequence of events that occur on your UI or in your code that easily reproduces the problem?  Are you able to consitently reproduce the problem on multiple machines?

Thanks.
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 2 of 5
(4,770 Views)

Thank you for the response.  I figured out what was happening.  I simply loaded a panel with a please wait message and displayed it while doing some processing and then discarded the panel.  A few moments after discarding the panel, the program would crash.

temppanel = LoadPanel( 0, "TestProgram.uir", PLEASEWAIT );

DisplayPanel( temppanel );

..

..

DiscardPanel(temppanel);

 

This was done in the middle of subroutine called by a control callback so I am guessing that CVI is getting confused that a panel was created and discarded within a callback?

I have removed this please wait message and I don't have it crashing.

 

 

0 Kudos
Message 3 of 5
(4,770 Views)
Have you tried loading the panel initially hidden when your program starts and just using DisplayPanel and HidePanel in the callback?
----
I am the founder of CnCSoftwareSolutions. When not cleaning up baby drool, I write about test data or work on Vision, a tool for understanding your test data. Visit me at www.cncsoftwaresolutions.com
0 Kudos
Message 4 of 5
(4,761 Views)
Hello Mande,

In general, you should have no problems loading and discarding a panel from a control callback.  It's interesting that this was causing the problem.  Would you mind providing some example code that demonstrates the problem you are seeing, because as you mentioned it could have been caused by the setup of your application, or it could be something else that was causing this behavior.

Thanks
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 5 of 5
(4,741 Views)