Page 1 of 1

TrendLine Crush

Posted: Wed Apr 14, 2004 5:56 am
by 9079459
Hi
if in code of my previous post "TrendLines Issues" the command button event handler replace with code below it crushes the app and sometimes Windows.
nefis

Code: Select all

Private Sub Command1_Click()
  Dim lt As TeeChart.IDrawLineTool
  Dim L As Long
  Dim L2 As Long
  
  If Xd = 0 Then
    Xd = TChart1.Axis.Bottom.Maximum - TChart1.Axis.Bottom.Minimum
  End If
  If Yd = 0 Then
    Yd = TChart1.Axis.Left.Maximum - TChart1.Axis.Left.Minimum
  End If

  Set lt = TChart1.Tools.Items(TChart1.Tools.Add(tcDrawLine)).asDrawLine
  With lt
    L = .AddLine(0, 0, 1, 1)
    lt.Lines.Items(L).StartPos.X = TChart1.Axis.Bottom.Minimum + Rnd * Xd
    lt.Lines.Items(L).StartPos.Y = TChart1.Axis.Right.Minimum + Rnd * Yd
    lt.Lines.Items(L).EndPos.X = TChart1.Axis.Bottom.Minimum + Rnd * Xd
    lt.Lines.Items(L).EndPos.Y = TChart1.Axis.Right.Minimum + Rnd * Yd
    L2 = .AddLine(0, 0, 1, 1)
    lt.Lines.Items(L2).StartPos.X = lt.Lines.Items(L).EndPos.X
    lt.Lines.Items(L2).StartPos.Y = lt.Lines.Items(L).EndPos.Y
    lt.Lines.Items(L2).EndPos.X = lt.Lines.Items(L).EndPos.X + 1000 * (lt.Lines.Items(L).EndPos.X - lt.Lines.Items(L).StartPos.X)
    lt.Lines.Items(L2).EndPos.Y = lt.Lines.Items(L).EndPos.Y + 1000 * (lt.Lines.Items(L).EndPos.Y - lt.Lines.Items(L).StartPos.Y)
    lt.EnableDraw = False
  End With
  Call TChart1.Repaint
End Sub
the changed part

Code: Select all

    lt.Lines.Items(L2).EndPos.X = lt.Lines.Items(L).EndPos.X + 1000 * (lt.Lines.Items(L).EndPos.X - lt.Lines.Items(L).StartPos.X)
    lt.Lines.Items(L2).EndPos.Y = lt.Lines.Items(L).EndPos.Y + 1000 * (lt.Lines.Items(L).EndPos.Y - lt.Lines.Items(L).StartPos.Y)

Posted: Wed Apr 14, 2004 1:39 pm
by Chris
Hi --
if in code of my previous post "TrendLines Issues" the command button event handler replace with code below it crushes the app and sometimes Windows.
I'm afraid I can't reproduce this behaviour here using Visual Studio 6.0 SP5, Windows v.5.2.2790 and TeeChart AXv6.0.0.4.

Posted: Thu Apr 15, 2004 6:26 am
by 9079459
Hi
I'm afraid I can't reproduce this behaviour here using Visual Studio 6.0 SP5, Windows v.5.2.2790 and TeeChart AXv6.0.0.4.
I use Windows ME and the rest is the same.
Could you try bigger numbers?

Code: Select all

    lt.Lines.Items(L2).EndPos.X = lt.Lines.Items(L).EndPos.X + 100000 * (lt.Lines.Items(L).EndPos.X - lt.Lines.Items(L).StartPos.X) 
    lt.Lines.Items(L2).EndPos.Y = lt.Lines.Items(L).EndPos.Y + 100000 * (lt.Lines.Items(L).EndPos.Y - lt.Lines.Items(L).StartPos.Y)
Additionally, sometimes the extension line has different slope so the angle between it and the "main" is not 180 degrees.

nefis

Posted: Thu Apr 15, 2004 8:52 am
by Chris
Hi --
Could you try bigger numbers?
I tried values of 10000000 without getting a crash.
Additionally, sometimes the extension line has different slope so the angle between it and the "main" is not 180 degrees.
At 100000 this did not occur, at 1000000 it did. How will this problem affect your code practically?

Posted: Thu Apr 15, 2004 9:51 am
by 9079459
I'm trying to project the extension as far as possible.
1'000'000 has no sence indeed. But even 1'000 causes either a crush or a wrong slope of the extension line on my system. Even 10 works well but it's unacceptable for my purpose.

Posted: Thu Apr 15, 2004 10:01 am
by 9079459
the crush happens in Windows DIB Engine (DIBENG.DLL)
maybe you need to try reproduce the crush on WinME system

Posted: Thu Apr 15, 2004 10:56 am
by Chris
Hi --
the crush happens in Windows DIB Engine (DIBENG.DLL)
maybe you need to try reproduce the crush on WinME system
Mmm ... try doing a search for DIBENG.DLL on Google and have a look at the first two links which are to support.microsoft.com. Maybe this error is associated to one of these two recognised problems? You'll like the workaround to the Age of Empires problem :lol:

Posted: Sun Apr 18, 2004 1:25 pm
by 9079459
Hi,
the crush is caused by IDrawLineTool Selected property.
since it's on your fix list the issue can be dropped for now.
but i don't like to know that the slope of line is not what one can expect

nefis

Posted: Mon Apr 19, 2004 3:12 pm
by 9079459
Hi,
unfortunately, the last build doesn't fix any TrendLine issues.
nefis

Posted: Tue Apr 20, 2004 6:37 am
by Chris
Hi --
the crush is caused by IDrawLineTool Selected property.

This property is not in any of the code mentioned in this thread.
since it's on your fix list the issue can be dropped for now.

Maybe you are referring to the problem we discussed on:
http://www.teechart.net/support/modules ... pic&p=2199
but i don't like to know that the slope of line is not what one can expect
The slope problem is related to a Windows DIB Engine (DIBENG.DLL)
problem in WinME and cannot be reproduced on any other platform.
unfortunately, the last build doesn't fix any TrendLine issues.
Which build are you referring to here and to which problems?