Jump to content
Software FX Community

How to clear ChartFX object?


Recommended Posts

Hello,

I have a problem on memory issue.

I am using a timer, so the chart on ActiveX Control is being refreshed in

every second.

The chart is not dynamically created. That is, the chart is statically

docked on ActiveX Control.

So, I clear the objects in order to release memory.

However, when some hours elapse, an error occur on a method like ClearData.

And, when I try to debug(simply, Ctrl+C), "memory lack" message pop up.

But, at that time, VB6.exe use system memory under 20MB and virtual memory

under 20MB.

My system memory is totally 1GB.

My code like this... (VB)

Thanks in adv. :)

Private Sub Timer1_Timer()

call RefreshChart(m_chartSrc)

End Sub

Private Sub RefreshChart(ByRef chartSrc As clsChartDefinedMyClassModule)

With cfxTheStaticChartOnActiveXControl

'Clear

.ClearData CD_ALLDATA Or CD_OTHER

.ClearLegend CHART_LEGEND Or CHART_SERLEG Or CHART_KEYLEG Or

CHART_FIXLEG Or CHART_YLEG

'General Setting

.BorderStyle = BORDER_NONE

.BottomGap = 30

''''''''''''''''''''''''''''

'X-Axis Setting

.Axis(AXIS_X).Visible = True

For i = 0 To chartSrc.XAxis.LabelCount - 1

.Axis(AXIS_X).Label(i) = chartSrc.XAxis.Label(i)

Next i

.Axis(AXIS_X).Title = chartSrc.XAxis.Title

'Series Setting

.OpenDataEx COD_VALUES, chartSrc.NSeries, chartSrc.NValues

For i = 0 To chartSrc.NSeries - 1

'Legend

.Series(i).Legend = RTrim(chartSrc.Series(i).Legend)

'Value

For j = 0 To chartSrc.NValues - 1

.Series(i).Yvalue(j) = Val(chartSrc.Series(i).Yvalue(j))

If .Series(i).Yvalue(j) > MaxYValue Then

MaxYValue = .Series(i).Yvalue(j)

End If

Next j

.Series(i).MarkerShape = MK_CUBE

Next i

.CloseData COD_VALUES

'SerLegBox Setting

.SerLegBoxObj.Docked = TGFP_RIGHT

.SerLegBoxObj.BkColor = RGB(255, 255, 255)

.SerLegBoxObj.Visible = chartSrc.SerLegBox

.SerLegBoxObj.AutoSize = True

'Y-Axis Setting

.Axis(AXIS_Y).Visible = True

.Axis(AXIS_Y).Decimals = chartSrc.YAxis.Decimals

.Axis(AXIS_Y).Title = chartSrc.YAxis.Title

.RecalcScale

.Width = picResult.Width - 3

.Height = picResult.Height - 3

End With

End Sub

Link to post
Share on other sites

I don't know what the lastest service pack is.

The version of Cfx4032.ocx is 4.0.19.0 and the version of SfxBar.dll is

1.0.20.0.

Are these the lastest one?

How can I get the lastest service pack?

I think my class has no memory leak problem.

I always "set nothing" whenever "set new".

And I've checked it in "for loop of 10000'th".

And if the source of the problem has been on memory leak other than ChartFX,

the error point would be changed.

But the error point was always on the function where I posted.

"SoftwareFX Support" <noreply@softwarefx.com> wrote in message

news:h1jKDQmMFHA.3800@webserver3.softwarefx.com...

> Are you using the latest service pack ?

>

> What is clsChartDefinedMyClassModule ? is that your own class ? how do you

> know the leak is not there ?

>

> Can you provide us with a program that reproduces the problem without

using

> any external class ?

>

> --

> FP

> Software FX

>

>

Link to post
Share on other sites

I downloaded the lastest service pack. :)

After test, I'll post the result on here.

Thank you~

"greatcap" <greatcap@somansa.com> wrote in message

news:yfZNj6$MFHA.1660@webserver3.softwarefx.com...

> I don't know what the lastest service pack is.

> The version of Cfx4032.ocx is 4.0.19.0 and the version of SfxBar.dll is

> 1.0.20.0.

> Are these the lastest one?

> How can I get the lastest service pack?

>

> I think my class has no memory leak problem.

> I always "set nothing" whenever "set new".

> And I've checked it in "for loop of 10000'th".

>

> And if the source of the problem has been on memory leak other than

ChartFX,

> the error point would be changed.

> But the error point was always on the function where I posted.

>

>

> "SoftwareFX Support" <noreply@softwarefx.com> wrote in message

> news:h1jKDQmMFHA.3800@webserver3.softwarefx.com...

> > Are you using the latest service pack ?

> >

> > What is clsChartDefinedMyClassModule ? is that your own class ? how do

you

> > know the leak is not there ?

> >

> > Can you provide us with a program that reproduces the problem without

> using

> > any external class ?

> >

> > --

> > FP

> > Software FX

> >

> >

>

>

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...