hi,
I try to use the event OnGetAxisLabel in my application, but when this event is generated an exception is raised when I try to read the string "LabelText".
I found the problem : in my project options I'm not using the option "huge strings", which corresponds to {$H-}.
how can I bypass this problem ?
Thanks
Franck
Exception on the event OnGetAxisLabel
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Franck,
I've been able to reproduce that. TeeChart needs "Huge Strings" so to work it around you can do something like the code below forcing the use of "Huge Strings" before executing the GetAxisLabel event.
I've been able to reproduce that. TeeChart needs "Huge Strings" so to work it around you can do something like the code below forcing the use of "Huge Strings" before executing the GetAxisLabel event.
Code: Select all
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, TeEngine, Series, ExtCtrls, TeeProcs, Chart;
type
TForm1 = class(TForm)
Chart1: TChart;
Series1: TLineSeries;
{$H+}
procedure Chart1GetAxisLabel(Sender: TChartAxis; Series: TChartSeries;
ValueIndex: Integer; var LabelText: String);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Chart1GetAxisLabel(Sender: TChartAxis;
Series: TChartSeries; ValueIndex: Integer; var LabelText: String);
begin
LabelText:='abc';
end;
end.
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Franck,
TeeChart needs "Huge Strings" because it uses several PChar castings. If you disable "Huge Strings" your application with TeeChart may not run, depending on the features you use. However, you can enable/disable "Huge Strings" doing something like this:
However, not using "Huge Strings" may lead you to several other problems in Delphi. Our suggestion is to do the opposite, disable them when you don't want to use them.
TeeChart needs "Huge Strings" because it uses several PChar castings. If you disable "Huge Strings" your application with TeeChart may not run, depending on the features you use. However, you can enable/disable "Huge Strings" doing something like this:
Code: Select all
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, TeEngine, Series, ExtCtrls, TeeProcs, Chart;
type
TForm1 = class(TForm)
Chart1: TChart;
Series1: TLineSeries;
procedure Chart1GetAxisLabel(Sender: TChartAxis; Series: TChartSeries;
ValueIndex: Integer; var LabelText: {$H+}String{$H-});
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Chart1GetAxisLabel(Sender: TChartAxis;
Series: TChartSeries; ValueIndex: Integer; var LabelText: {$H+}String{$H-});
begin
LabelText:='abc';
end;
end.
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 |