Написал код на загрузку ListView с иконками но почему то ругается при компиляции. Хотя после ошибки все равно запускается но без иконки и только с одним итемом. Вот код
Код:
procedure TForm1.FormCreate(Sender: TObject);
const
SectionName = 'Game';
var
Keys: TStringList;
Inifile: TMemIniFile;
I: Integer;
A: array [0..78] of Char;
s:TIcon;
begin
ListView1.ViewStyle := vsIcon;
Inifile := TMemIniFile.Create('Settings.ini');
Keys := TStringList.Create;
s:=tIcon.Create;
Inifile.ReadSection(SectionName, Keys);
for I := 0 to Keys.Count - 1 do
with ListView1.Items.Add do
begin
Caption := Keys[i];
StrPCopy(A, Inifile.ReadString(SectionName, Keys[i], ''));
ListView1.LargeImages.Handle:= ExtractIcon(HInstance, A,0);
end;
s:=nil;
FreeAndNil(Keys);
FreeAndNil(Inifile);
end;
выдает ошибку на
Код:
ListView1.LargeImages.Handle:= ExtractIcon(HInstance, A,0);
В чем ошибка? Заранее спасибо