User (Legacy) Posted October 12, 2000 Report Share Posted October 12, 2000 Hello, I just found another situation in which the control crashes. Using purely COM Automation, it certainly happen in PIE charts, I believe it also can happen DONOUGHT charts, and so far I was not able to get this error in Bar or line charts of any kind. This crash happens if you listen for the LButtonDblClick und RButtonDBLClick events and change the data of the chart during the event handling. If you use a pie chart for doing so the following, very fast combination of clicks will crash the control. LBUTTON LBUTTON RBUTTON. As I observed the problem, it looks like that the control still has the the old data (not yet displayed the new data) while the RBUTTON event comes in. This seems to cause the problem, but this is only an observation. I am using VC6, and I just generated all the wrapper classes for the ActiveX control. Then I generated event sink handler and used the following code to reproduce the problem. void CChartfxDlg::OnLButtonDblClkChart1(short x, short y, short nSerie, long nPoint, short FAR* nRes) { // TODO: Add your control notification handler code here CChartFX *chart = (CChartFX*)this->GetDlgItem(IDC_CHART1); chart->OpenDataEx(1, 4, 4); chart->GetSeries().GetItem(0).SetYvalue(0, 1); chart->GetSeries().GetItem(0).SetYvalue(1, 2); chart->GetSeries().GetItem(0).SetYvalue(2, 3); chart->GetSeries().GetItem(0).SetYvalue(3, 4); chart->GetSeries().GetItem(1).SetYvalue(0, 1); chart->GetSeries().GetItem(1).SetYvalue(1, 2); chart->GetSeries().GetItem(1).SetYvalue(2, 3); chart->GetSeries().GetItem(1).SetYvalue(3, 4); chart->GetSeries().GetItem(2).SetYvalue(0, 1); chart->GetSeries().GetItem(2).SetYvalue(1, 2); chart->GetSeries().GetItem(2).SetYvalue(2, 3); chart->GetSeries().GetItem(2).SetYvalue(3, 4); chart->GetSeries().GetItem(3).SetYvalue(0, 1); chart->GetSeries().GetItem(3).SetYvalue(1, 2); chart->GetSeries().GetItem(3).SetYvalue(2, 3); chart->GetSeries().GetItem(3).SetYvalue(3, 4); chart->CloseData(1); *nRes = 1 ; } void CChartfxDlg::OnRButtonDblClkChart1(short x, short y, short FAR* nRes) { // TODO: Add your control notification handler code here CChartFX *chart = (CChartFX*)this->GetDlgItem(IDC_CHART1); chart->OpenDataEx(1, 1, 1); chart->GetSeries().GetItem(0).SetYvalue(0, 5000); chart->CloseData(1); *nRes = 1; } void CChartfxDlg::OnRButtonUpChart1(short x, short y, short FAR* nRes) { // TODO: Add your control notification handler code here *nRes = 1; } As I said it is very hard to do so, but possible. It also looks like that this may actually be easier to reproduce if the event handler took more time. This is the case in our application - there the actions in the event sink handlers are bit more complicated. But since we are using our own language I cannot post that code directly. But because I could reproduce the problem in VC I believe this is an problem in the control. I hope you are able to reproduce it and then be able to fix that. It happens only if you click really fast. Please let me know how you proceed. Thanks a lot in advance, Stephan Klaffer DecisionWorks London Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.