C++ Update of TDBChart data plot variables failure
Posted: Fri Jul 07, 2006 2:51 pm
While trying to change the designtime settings for a line plot, I used the following code:
//----------------------------------
if (Series1->Count() != 0)
{
// remove all previous data, then lets add the points
Series1->Clear();
}
// ready for new data
Series1->XValues->Order = loNone;
Series1->YValues->Order = loNone;
CPlotData->HeaderLines = 2;
CPlotData->FieldSeparator = ",";
CPlotData->Fields->Clear();
CPlotData->AddField("X",XIdx);
CPlotData->AddField("Y",YIdx);
CPlotData->FileName = SelectFile->FileName;
CPlotData->Load();
The runtime program encounters a runtime error:
raised exception class EAccessViolation with message 'Access violation at address 00407101 in module 'DeltaPress.exe. Read of address 0000004D'.
This look to be a bad pointer reference. The code looks clean from a C point of view but I must be misusing one of the values.
When I "break" at the exception, the following line is highlighted.
DBChart1->SubTitle->Text->Clear();
Update:
I commented all references to SubTitle and the code executes without encountering an exception.
The plot show no data with a single dotted line in the horizonal and vertical axis. The Title is TDBChart which is the default.
I an trying to change the plotting values during runtime using the same ideas I observed during the design time interface.
Any Ideas?
Thanks in advance.
//----------------------------------
if (Series1->Count() != 0)
{
// remove all previous data, then lets add the points
Series1->Clear();
}
// ready for new data
Series1->XValues->Order = loNone;
Series1->YValues->Order = loNone;
CPlotData->HeaderLines = 2;
CPlotData->FieldSeparator = ",";
CPlotData->Fields->Clear();
CPlotData->AddField("X",XIdx);
CPlotData->AddField("Y",YIdx);
CPlotData->FileName = SelectFile->FileName;
CPlotData->Load();
The runtime program encounters a runtime error:
raised exception class EAccessViolation with message 'Access violation at address 00407101 in module 'DeltaPress.exe. Read of address 0000004D'.
This look to be a bad pointer reference. The code looks clean from a C point of view but I must be misusing one of the values.
When I "break" at the exception, the following line is highlighted.
DBChart1->SubTitle->Text->Clear();
Update:
I commented all references to SubTitle and the code executes without encountering an exception.
The plot show no data with a single dotted line in the horizonal and vertical axis. The Title is TDBChart which is the default.
I an trying to change the plotting values during runtime using the same ideas I observed during the design time interface.
Any Ideas?
Thanks in advance.