Index

From: David Berneda
Subject: Re: Access Violation
Date: Thu, 20 Mar 2003 14:00:04 +0100
Newsgroup: steema.public.teechart6.kylix  

Hi Gareth
This is very strange.
Isn't MySQL dataset derived from TDataSet ?
TDataSet derives from TComponent so the casting at RemoveAllLinkedSeries
shouldn't fail.
If you replace the casting to this:

Procedure TChartSeries.RemoveAllLinkedSeries;
var t : Integer;
begin
if Assigned(FDataSources) then
for t:=0 to DataSources.Count-1 do
if Assigned(DataSources[t]) and
(TObject(DataSources[t]) is TChartSeries) then // 6.02, changed to
TObject
TChartSeries(DataSources[t]).RemoveLinkedSeries(Self);
end;

Does it fail ?
regards
david

"Gareth Bult" wrote in message
news:p1d$SJs7CHA.1944@teepc...
> Hi,
>
> I'm running a standard 3-D line chart with one DB series on it taken from
a
> MySQL Dataset. When the application exits, I get an access violation in
the
> code "RemoveAllLinkedSeries" routine as it appears that DataSources[t]
> isn't a decendant of TComponent, hence the typecase and comparison to
> TChartSeries makes it very unhappy.
>
> Bug?
>
> (I've notices this in previous versions of the code, indeed it's led me to
> avoid DB series... )
>
> Regards,
> Gareth
>
>