Registriert seit: 3. Mär 2006
Ort: Waldbronn
4.303 Beiträge
Delphi 2009 Professional
|
AV bei frmSettings.ComponentCount
1. Aug 2006, 13:26
Ich bekomme eine AV in dieser Zeile:
for i := 0 to frmSettings.ComponentCount - 1 do begin
Code:
Delphi-Quellcode:
procedure TfrmSettings.FormCreate(Sender: TObject);
var Ini, Skin : TIniFile;
s : String;
BackgrndFade : TColor;
i : Integer;
begin
Ini := TIniFile.Create(ExtractFilePath(application.exename) + 'settings.ini');
try
s := Ini.ReadString('Settings', 'Skin', ExtractFilePath(Application.ExeName) + 'skins\blue.dpsf');
finally
Ini.Free;
end;
if FileExists(s) then begin
Skin := TIniFile.Create(s);
try
for i := 0 to frmSettings.ComponentCount - 1 do begin <:=-------- Diese Zeile
if frmSettings.Components[i] is TXiPanel then begin
(frmSettings.Components[i] as TXiPanel).ColorFace := StringToColor(Skin.ReadString('Backgrnd', 'Face', '$00FE9741'));
if (frmSettings.Components[i] as TXiPanel).Name <> 'xiBg' then
(frmSettings.Components[i] as TXiPanel).ColorGrad := StringToColor(Skin.ReadString('Backgrnd', 'Face', '$00FE9741'))
else
xiBg.ColorGrad := StringToColor(Skin.ReadString('Backgrnd', 'Grad', 'clSkyBlue'));
end;
end;
{ BackgrndFade := StringToColor(Skin.ReadString('Backgrnd', 'Face', '$00FE9741'));
xiBg.ColorFace := BackgrndFade;
// xiInUse.ColorFace := BackgrndFade;
// xiInUse.ColorGrad := BackgrndFade;
// xiSets.ColorFace := BackgrndFade;
//xiSets.ColorGrad := BackgrndFade;
xiBg.ColorGrad := StringToColor(Skin.ReadString('Backgrnd', 'Grad', 'clSkyBlue'));}
lSkinName.Caption := Skin.ReadString('Skin', 'Name', '<unnamed>');
finally
Skin.Free;
end;
eSkinPath.Text := s;
end else begin
lSkinName.Caption := 'Blue';
eSkinPath.Text := ExtractFilePath(Application.ExeName) + 'skins\blue.dpsf';
Showmessage('Skinfile not found!');
end;
end;
So sieht sie aus:
Code:
---------------------------
Debugger Exception Notification
---------------------------
Project DarkPlayerII.exe raised exception class EAccessViolation with message ' Access violation at address 0041A778 in module 'DarkPlayerII.exe'. Read of address 00000010'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
Fabian Eigentlich hat MS Windows ab Vista den Hang zur Selbstzerstörung abgewöhnt – mkinzler
|
|
Zitat
|