Access violations from TeeChart7.ocx
-
- Newbie
- Posts: 23
- Joined: Fri Feb 23, 2007 12:00 am
Access violations from TeeChart7.ocx
When i run my application with many Teechart (10) and data and title on chart is changed by time. I got:
"Access violation at address 504D8251 in module 'TeeChart7.ocx'. Read of address 0000000."
To do live data on chart, i use:
+ m_TeeChart.GetAxis().GetBottom().SetMinMax: to move time on chart
+ m_TeeChart.GetHeader().SetCaption: update title on chart
When i only run with 1 or 2 chart, it is OK. But i run about 10 chart, it throw exception.
Is there a mechanism to trap the error with a try ... catch or get a message from the ocx as to what went wrong?
"Access violation at address 504D8251 in module 'TeeChart7.ocx'. Read of address 0000000."
To do live data on chart, i use:
+ m_TeeChart.GetAxis().GetBottom().SetMinMax: to move time on chart
+ m_TeeChart.GetHeader().SetCaption: update title on chart
When i only run with 1 or 2 chart, it is OK. But i run about 10 chart, it throw exception.
Is there a mechanism to trap the error with a try ... catch or get a message from the ocx as to what went wrong?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hello Tuan Nguyen,
Are you using latest TeeChart Pro v7 ActiveX available at the client area, which is v7.0.1.4?
If the problem persists, could you please send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Are you using latest TeeChart Pro v7 ActiveX available at the client area, which is v7.0.1.4?
If the problem persists, could you please send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 23
- Joined: Fri Feb 23, 2007 12:00 am
Hi Narcís
I'm using TeeChart Pro v7 ActiveX v7.0.1.4. I detected the big problem on Tee Chart:
+ Step1: use your [Add data arrays] demo for VC and add some chart on it.
+ Step2: assign name for these chart.
+ Step3: run application, the application is crash with exception: "Unhandled exception in VCTeeChart5.exe: 0xC0000005: Access Violation."
It is urgent problem. I'm looking to forward your feedback.
Best regard,
Tuan Nguyen
I'm using TeeChart Pro v7 ActiveX v7.0.1.4. I detected the big problem on Tee Chart:
+ Step1: use your [Add data arrays] demo for VC and add some chart on it.
+ Step2: assign name for these chart.
+ Step3: run application, the application is crash with exception: "Unhandled exception in VCTeeChart5.exe: 0xC0000005: Access Violation."
It is urgent problem. I'm looking to forward your feedback.
Best regard,
Tuan Nguyen
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Tuan Nguyen,
It's strange because this is working fine here using v7.0.1.4. Could you please uninstall your current v7 installation, download v7.0.1.4 from the download area, install it to make sure you are using the latest version available at the client area and check if the problem persists?
Thanks in advance.
It's strange because this is working fine here using v7.0.1.4. Could you please uninstall your current v7 installation, download v7.0.1.4 from the download area, install it to make sure you are using the latest version available at the client area and check if the problem persists?
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 23
- Joined: Fri Feb 23, 2007 12:00 am
Hi Narcís,
Thank you very much for your supports.
I detected my problem, because i don't synchronize between 2 thread: fill data to chart and draw data on chart.
However, i still has a problem with chart. Chart is flicker when i do the following step:
+ Create 1 thread to process the following function:
Please give me some ideas to fix the problem.
Best regards,
Tuan Nguyen
Thank you very much for your supports.
I detected my problem, because i don't synchronize between 2 thread: fill data to chart and draw data on chart.
However, i still has a problem with chart. Chart is flicker when i do the following step:
+ Create 1 thread to process the following function:
Code: Select all
void CMulti_ChartDlg::Run()
{
double dbMin = 0;
double dbMax = 100;
CString szLog = _T("");
for (int i = 0; i < 10000; i++)
{
//fill data into chart
double dbValueX = dbMin;
m_TeeChart1.Series(0).Clear();
for (int i =0 ; i < 10; i++)
{
dbValueX++;
m_TeeChart1.Series(0).AddXY(dbValueX, 0, _T(""), 0);
}
Sleep(100);
//display data on chart
dbMin++;
dbMax++;
m_TeeChart1.GetAxis().GetBottom().SetMinMax(dbMin, dbMax);
szLog.Format(_T("From: %g To: %g"), dbMin, dbMax);
//update title on chart
m_TeeChart1.GetHeader().SetCaption(szLog);
}
}
Best regards,
Tuan Nguyen
Last edited by Tuan Nguyen on Thu Jan 24, 2008 11:48 am, edited 1 time in total.
-
- Newbie
- Posts: 23
- Joined: Fri Feb 23, 2007 12:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Tuan,
Thanks for the information. Can you reproduce the problem without using threads or using timers instead?
If the problem persits could you please send us a simple example project we can run "as-is" to reproduce the problem here? You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Thanks for the information. Can you reproduce the problem without using threads or using timers instead?
If the problem persits could you please send us a simple example project we can run "as-is" to reproduce the problem here? You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 23
- Joined: Fri Feb 23, 2007 12:00 am
Hi Tuan,
we've been checking this issue, and we've seen the TeeChart multi-threading department is not resilient to VC++ multi-threading.
For the moment we've found some tricks which make the problem to appear not so often (see the code below).
We still investigating it to try to find a good solution to make the problem disappears.
Could you please check if using the following code tricks (basically make use of the AutoRepaint method, and disable the mouse events for the Chart object) help you ?
we've been checking this issue, and we've seen the TeeChart multi-threading department is not resilient to VC++ multi-threading.
For the moment we've found some tricks which make the problem to appear not so often (see the code below).
We still investigating it to try to find a good solution to make the problem disappears.
Could you please check if using the following code tricks (basically make use of the AutoRepaint method, and disable the mouse events for the Chart object) help you ?
Code: Select all
void CMulti_ChartDlg::OnOK()
{
//Run();
m_TeeChart1.SetEnabled(false);
AfxBeginThread(WorkerThreadProc1, this, THREAD_PRIORITY_NORMAL,0,0,NULL);
Sleep(5);
//AfxBeginThread(WorkerThreadProc2, this, THREAD_PRIORITY_NORMAL,0,0,NULL);
}
void CMulti_ChartDlg::Run()
{
double dbMin = 0;
double dbMax = 100;
CString szLog = _T("");
for (int i = 0; i < 10000; i++)
{
m_TeeChart1.SetAutoRepaint(false);
//m_TeeChart1.SetAutoRepaint(false);
//fill data into chart
double dbValueX = dbMin;
DWORD numElements[] = {12};
COleSafeArray p_pArrXValues;
COleSafeArray p_pArrYValues;
p_pArrXValues.Create(VT_R8, 1, numElements);
p_pArrYValues.Create(VT_R8, 1, numElements);
long lIndex = -1;
for (int i = 0 ; i < 10; i++)
{
lIndex++;
dbValueX++;
p_pArrXValues.PutElement(&lIndex, &dbValueX);
p_pArrYValues.PutElement(&lIndex, &dbValueX);
}
m_TeeChart1.Series(0).Clear();
m_TeeChart1.Series(0).AddArray(p_pArrYValues.GetOneDimSize(), p_pArrYValues, p_pArrXValues);
//m_TeeChart1.SetAutoRepaint(true);
// m_TeeChart1.SetAutoRepaint(false);
Sleep(100);
//display data on chart
dbMin++;
dbMax++;
m_TeeChart1.GetAxis().GetBottom().SetMinMax(dbMin, dbMax);
szLog.Format(_T("From: %g To: %g"), dbMin, dbMax);
//update title on chart
m_TeeChart1.GetHeader().SetCaption(szLog);
m_TeeChart1.SetAutoRepaint(true);
m_TeeChart1.Repaint();
}
}
Pep Jorge
http://support.steema.com
http://support.steema.com
-
- Newbie
- Posts: 23
- Joined: Fri Feb 23, 2007 12:00 am
Hi Pep,
Thank you very much for your efforts.
We try with your code tricks. It is better old code, but problem about [Throw exception:"Access violation at address 504D8251 in module 'TeeChart7.ocx'. Read of address 0000000."] continue happening. Do you show me how to close error message: "Access violation at address 504D8251 in module 'TeeChart7.ocx'. Read of address 0000000.". It won't display in my application. Today, we will send new release for customer. Could you feedback for me today?
Best regards,
Tuan Nguyen
Thank you very much for your efforts.
We try with your code tricks. It is better old code, but problem about [Throw exception:"Access violation at address 504D8251 in module 'TeeChart7.ocx'. Read of address 0000000."] continue happening. Do you show me how to close error message: "Access violation at address 504D8251 in module 'TeeChart7.ocx'. Read of address 0000000.". It won't display in my application. Today, we will send new release for customer. Could you feedback for me today?
Best regards,
Tuan Nguyen
The problem appears to occur because the Chart is created on the form and modified in the thread. If it were possible to modify the Chart contents in the form and not via thread (tested here - though intercepting/interrupting a running Chart would become a challenge), or create the Chart dynamically in the thread (not tested) then the problem shouldn't occur.
Pep Jorge
http://support.steema.com
http://support.steema.com
-
- Newbie
- Posts: 23
- Joined: Fri Feb 23, 2007 12:00 am
Do you show how to create the Chart dynamically in application? I found 1 thread [http://www.teechart.net/support/viewtopic.php?t=5173] about it, but i can't find "Create ActiveX TChart component at Runtime on MFC app (Form)" subject. Can you show for me about it?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Tuan,
I have forwarded you the example in the attachments newsgroup.
I have forwarded you the example in the attachments newsgroup.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |