Вверх ↑
Разработчик
Ответов: 26067
Рейтинг: 2121
#1: 2011-11-17 10:30:48 ЛС | профиль | цитата
А если список заведомо сделать на полное количество устройств. те вместо вот этого


  for Ch := 'a' to 'z' do
begin
if LongBool(DrivesMask and 1) then
begin
if _prop_UpperCharInBox then
Control.Add('[-' + UpperCase(Ch) + '-]')
else
Control.Add('[-' + Ch + '-]');
VolList.Add('');
end;
DrivesMask := DrivesMask shr 1;
end;
сделать вот это

  for Ch := 'a' to 'z' do
begin
if LongBool(DrivesMask and 1) then
begin
if _prop_UpperCharInBox then
Control.Add('[-' + UpperCase(Ch) + '-]')
else
Control.Add('[-' + Ch + '-]');
end;
VolList.Add('');
DrivesMask := DrivesMask shr 1;
end;
Складываетс впечетление, что VolList.Items[] обращается к строке, которой нет

------------ Дoбавленo в 10.30:
Или вот тут поставить защиту, вместо вот этого


  for Idx := 0 to Ctl.Count - 1 do
begin
D.VolList.Items[Idx] := dspc + GetLabelDisk(Ctl.Items[Idx][3], False);
Vol := Ctl.Items[Idx] + D.VolList.Items[Idx];
if WD < Ctl.Canvas.TextWidth(Vol) then
WD := Ctl.Canvas.TextWidth(Vol);
end;
как-то так

  for Idx := 0 to Ctl.Count - 1 do
if idx < D.VolList.Count then
begin
D.VolList.Items[Idx] := dspc + GetLabelDisk(Ctl.Items[Idx][3], False);
Vol := Ctl.Items[Idx] + D.VolList.Items[Idx];
if WD < Ctl.Canvas.TextWidth(Vol) then
WD := Ctl.Canvas.TextWidth(Vol);
end;

карма: 22

0