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.
C++ Update of TDBChart data plot variables failure
C++ Update of TDBChart data plot variables failure
Last edited by scottpj on Fri Jul 07, 2006 3:10 pm, edited 1 time in total.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi scottpj,
This may be because DBChart1->SubTitle->Text doesn't have any line at this moment. You could try using:
This may be because DBChart1->SubTitle->Text doesn't have any line at this moment. You could try using:
Code: Select all
DBChart1->SubTitle->Text[0]="";
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 |
Try the fix and get a system error
[C++ Error] TabMethodDlg.cpp(203): E2285 Could not find a match for 'TStrings::operator =(char *)'
which is a basic problem with the default "" format is (char *) type and the SubTitle->Title does not have a method for the "=" operator.
Your attempted example seems to suggest that I only need to create a global variable and set a pointer to the SubTitle instance pointer?! Will try this.
which is a basic problem with the default "" format is (char *) type and the SubTitle->Title does not have a method for the "=" operator.
Your attempted example seems to suggest that I only need to create a global variable and set a pointer to the SubTitle instance pointer?! Will try this.
Could not create an instance
Tried to create an instance to TSubTitle MySubTitle. Could not get the approach to work.
Found that TSubTitle example (Chart_SubTitles .cpp and .h) which shows a class based on TBaseForm. This appears to be a strange usage?! Why is it a form.
This causes me to wonder how the DBChart1 instance is formed.
which is Base_DBChart.h(23) as a pointer.
This implies that the internal values must be created using some methods at the instance creation time which is buried in the Delphi code.
I will try to investigate.
Found that TSubTitle example (Chart_SubTitles .cpp and .h) which shows a class based on TBaseForm. This appears to be a strange usage?! Why is it a form.
This causes me to wonder how the DBChart1 instance is formed.
which is Base_DBChart.h(23) as a pointer.
This implies that the internal values must be created using some methods at the instance creation time which is buried in the Delphi code.
I will try to investigate.
[Solved]Misuse of /Bad interface to SetXValue
I Found that a single statement for declaring X and Y works better with out any exceptions.
Series1->AddXY(XValue,YValue ,"",clTeeColor);
Instead of setting each value of X and Y using a separate statements.
Series1->XValue[LoopCnt] = UIValues.V;
Series1->YValue[LoopCnt] = UIValues.V;
The exceptions are caused by the values being evaluated as addresses.
This corruption of memory could explain the problems that I had with the titles. The titles are now where they should be.
Series1->AddXY(XValue,YValue ,"",clTeeColor);
Instead of setting each value of X and Y using a separate statements.
Series1->XValue[LoopCnt] = UIValues.V;
Series1->YValue[LoopCnt] = UIValues.V;
The exceptions are caused by the values being evaluated as addresses.
This corruption of memory could explain the problems that I had with the titles. The titles are now where they should be.