LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

application crashes when setting attribue of GRAPH control

The CVI7.0 application crashes with FATAL RUN-TIME ERROR when the GRAPH control is programmed. The code which makes the error is:
InsertAxisItem (timepanel, TIMEPANEL_GRAPH, VAL_BOTTOM_XAXIS, i, pAxisLabel[i], pAxisItemValue[i]-nStartIndex);
FATAL RUN-TIME ERROR:   "TimeWave.c", line 216, col 9, thread id 0x00000F60:   The program has caused a 'General Protection' fault at 001B:685C08B3.
I found the pointers of pAxisLabel and pAxisItemValue were unexpectedly freed! They were just allocated space few lines before. This part of code runs well most of the time.

Another line of code which makes FATAL RUN-TIME ERROR is also programming the GRAPH control.
SetAxisScalingMode (timepanel, TIMEPANEL_GRAPH, VAL_BOTTOM_XAXIS, nScaleMode, 0.0, (double)(lnSize-1));
and the error message is:
 FATAL RUN-TIME ERROR:   "TimeWave.c", line 200, col 5, thread id 0x00000B78:   The program has caused a 'General Protection' fault at 001B:685C08B3.
I debuged the application and ran it step by step. I found that the app crashed when executing the code above, sometimes a global pointer was unexpectedly freed, sometimes the pointer was normal and no further clue was found.
This error doesn't happen consistently. When I debuged the application and ran it step by step, this error usually doesn't happen. But when the application run automatically, the error happens.
 
 
Thanks.
 
ZSW
0 Kudos
Message 1 of 2
(2,728 Views)
Thanks everbody. All these errors are gone when I reinstall CVI !
0 Kudos
Message 2 of 2
(2,720 Views)