Looping through RVData items -> access violation
Posted: Sun Apr 02, 2006 11:47 am
What's wrong with the following:
for I:= 0 to RVData.ItemCount - 1 do
begin
if RVData.GetItemStyle(I) >= 0 then
begin
Strings.AddObject(RVData.GetItemText(I), RVData.GetItem(I));
end
end;
So, upon clicking a toolbar button, I'm building a list of strings with pointers to the accompanying RVData items. After that I always get access violation in CRVFData unit at lines 4189-4190:
if not MouseMoveHotItem(HOffs,VOffs) then
SetCursor(GetNormalCursor);
for I:= 0 to RVData.ItemCount - 1 do
begin
if RVData.GetItemStyle(I) >= 0 then
begin
Strings.AddObject(RVData.GetItemText(I), RVData.GetItem(I));
end
end;
So, upon clicking a toolbar button, I'm building a list of strings with pointers to the accompanying RVData items. After that I always get access violation in CRVFData unit at lines 4189-4190:
if not MouseMoveHotItem(HOffs,VOffs) then
SetCursor(GetNormalCursor);