Print Page | Close Window

GetRange crash

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Chart Control
Forum Description: Topics Related to Codejock Chart Control
URL: http://forum.codejock.com/forum_posts.asp?TID=24114
Printed Date: 29 April 2024 at 9:09am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: GetRange crash
Posted By: yangyanhui
Subject: GetRange crash
Date Posted: 08 December 2020 at 12:55am
CXTPChartContent* pContent = GetContent();
CXTPChartSeriesCollection* pCollection = pContent->GetSeries();
CXTPChartDiagram2D* pDiagram = DYNAMIC_DOWNCAST(CXTPChartDiagram2D, pCollection->GetAt(0)->GetDiagram());

double internalValueX = ((CXTPChartDiagram2DAxisView*)pDiagram->GetAxisX()->GetAxisView())->PointToValue(pt.x);

I use these code in mousemove event. It crashes after I move my mouse several times. What may cause it?
thanks



Replies:
Posted By: yangyanhui
Date Posted: 08 December 2020 at 9:48pm
I can confirm that the coordinate is in the area of the chartctrl. PointToValue crashes.


Posted By: yangyanhui
Date Posted: 08 December 2020 at 11:36pm
when I move slowly.It works well,when I move the mouse fast,it will crash which is very strange


Posted By: yangyanhui
Date Posted: 09 December 2020 at 3:03am
I add sleep(50) after PointToValue. It works but there is a track shows where the mouse moved as it is not validated in time.


Posted By: yangyanhui
Date Posted: 17 December 2020 at 2:02am
I find the reason. It is because  I execute pDiagram->GetAxisX()->GetRange()->GetViewMaxValue(); when  I move the mouse. I now need to disable onmousemove when I zoom the range because I need to exeute PointToValue in mousemove event.How can i realize it,mutex does not work



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net