Yesterday I upgrade to TMS Component Pack v6.3.0.0!
How exactly can we reproduce this?
Hi i've got a stack overflow problem (use of AdvStringgrid.Objects) since i update (6.1.5 to 6.4.2). If i go back the problem is solved.
See :
type
PLigne = ^TLigne;
TLigne = class
private
FEtat: TEtat;
FStyleLigne: TStyleLigne;
FLevel: Integer;
FOldChap: TOldChap;
FLevelInOuvr: Integer;
FTypeSelected: TTypeSelected;
FinFormula : boolean
procedure TAdvGridPerso.GetCellColor(ACol,ARow: Integer;AState: TGridDrawState; ABrush: TBrush; AFont: TFont);
var
tmpLigne : PLigne;
begin
if Objects[0,Arow]=nil then
begin
New(tmpLigne);
tmpLigne^:=TLigne.Create;
Objects[0,ARow]:=TObject(tmpLigne); // On this line i turn in a loop (call getcellcolor and go on this line and call getcellcolor and...).
end;
...
Thank you for reply.
If i go far in the grid code i see the difference between the two version.
See :
function TBaseGrid.GetCellProperties(c, r: integer): TCellProperties;
....
if not Assigned(inherited Objects[c,r]) then // In the old version i first time its true. The second time its false (so Object is assigned). In the new version this 'if' is always true (Object never created ?).
begin
....
GetDefaultProps(c,r,AFont,ABrush,AColorTo,AMirrorColor,AMirrorColorTo,HA,VA,WW,GD); // This function call getcellcolor.
...
Does this mean your check for Objects[0,ARow] = nil doesn't prevent that you keep reassigning grid.Objects[]?
The question is :), what i'm doing wrong ? Or is it a Grid bug ?
Thank you for a reply.
I cannot guess all the details of how you use the grid.
Please reduce this to a simple small case and provide by email some sample source project with which the problem can be reproduced.
Ok, thank you for your fast reply.
I'll do this.
Problem was traced & solved. Next update will address this.