Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Chart Control
  New Posts New Posts RSS Feed - GetRange crash
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

GetRange crash

 Post Reply Post Reply
Author
Message
yangyanhui View Drop Down
Senior Member
Senior Member


Joined: 20 August 2020
Status: Offline
Points: 131
Post Options Post Options   Thanks (0) Thanks(0)   Quote yangyanhui Quote  Post ReplyReply Direct Link To This Post Topic: GetRange crash
    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
Back to Top
yangyanhui View Drop Down
Senior Member
Senior Member


Joined: 20 August 2020
Status: Offline
Points: 131
Post Options Post Options   Thanks (0) Thanks(0)   Quote yangyanhui Quote  Post ReplyReply Direct Link To This Post Posted: 08 December 2020 at 9:48pm
I can confirm that the coordinate is in the area of the chartctrl. PointToValue crashes.
Back to Top
yangyanhui View Drop Down
Senior Member
Senior Member


Joined: 20 August 2020
Status: Offline
Points: 131
Post Options Post Options   Thanks (0) Thanks(0)   Quote yangyanhui Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
yangyanhui View Drop Down
Senior Member
Senior Member


Joined: 20 August 2020
Status: Offline
Points: 131
Post Options Post Options   Thanks (0) Thanks(0)   Quote yangyanhui Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
yangyanhui View Drop Down
Senior Member
Senior Member


Joined: 20 August 2020
Status: Offline
Points: 131
Post Options Post Options   Thanks (0) Thanks(0)   Quote yangyanhui Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.199 seconds.