Goedemiddag beste toppers.
Ik zit met iets en vind dit vreemd.
exception class : EFCreateError
exception message : Cannot create file "C:\Users\Jan\AppData\Roaming\FinalPlayer\Effects. ini". Het systeem kan het opgegeven pad niet vinden.
00589ed7 +043 FinalPlayer.exe System.IniFiles 906 +4 TMemIniFile.UpdateFile ???
Helaas is dit niet bij mij en vraag me af waarom.
Code:
procedure SaveEffectItemsData;
var
EffectCount: Integer;
ASection: string;
Effect: TFinalEffectRecType;
IniEffects: TMemIniFile;
procedure DoSaveEffects;
var
Index: Integer;
begin
IniEffects.Clear;
with IniEffects do
begin
{ Effecten }
EffectCount := FinalEffectBase.Count;
WriteInteger('Effect', 'Count', EffectCount);
for Index := 0 to Pred(EffectCount) do
begin
ASection := 'Effect ' + Format('%.3d', [Index + 1]);
Effect := FinalEffectBase.GetRecord(Index);
WriteBool(ASection, 'Enabled', Effect.EffectRec.Enabled);
WriteInteger(ASection, 'Group', Effect.EffectRec.Group);
WriteString(ASection, 'Caption', Effect.EffectRec.Caption);
WriteString(ASection, 'FilePath', Effect.EffectRec.FilePath);
WriteString(ASection, 'Hint', Effect.EffectRec.Hint);
WriteString(ASection, 'ShortCap', Effect.EffectRec.ShortCap);
WriteInteger(ASection, 'Duration', Effect.EffectRec.Duration);
WriteBool(ASection, 'ShortCut', Effect.ShortCut.Enabled);
WriteBool(ASection, 'Partymode', Effect.ShortCut.State._Partymode);
WriteInteger(ASection, 'KeyState', Effect.ShortCut.State.KeyState);
WriteBool(ASection, 'Shift', Effect.ShortCut.State.Shift);
WriteBool(ASection, 'Ctrl', Effect.ShortCut.State.Ctrl);
WriteBool(ASection, 'Alt', Effect.ShortCut.State.Alt);
end;
{ Groepen }
for Index := 0 to Pred(MAX_GROUP_EFFECT) do
begin
WriteBool('Group ' + Format('%.1d', [Index]), 'Enabled', EffectGroupRec[Index].Enabled);
WriteString('Group ' + Format('%.1d', [Index]), 'Caption', EffectGroupRec[Index].Caption);
end;
end;
IniEffects.UpdateFile;
end;
begin
IniEffects := TMemIniFile.Create(AddBS(MainFolderPath) + __DEFAULT_EFFECTEN, TEncoding.Unicode);
_AddLog(_ReportLog, 'SaveEffectData: ' + IniEffects.FileName);
try
try
DoSaveEffects;
except
_AddLog(_ErrorLog, 'SaveEffectData Exception: Cannot create file ' + AddQuotes(IniEffects.FileName));
end;
finally
IniEffects.Free;
end;
end;
Deze routine wordt aangeroepen bij afsluiten programma.
Dit werkt goed en is zeldzaam dat dit gebeurd. Kan mij niet de indruk wekken dat opeens de IniEffects.UpdateFile; niet meer werkt.
Deze gebruiker ken ik niet en is niet zinvol dan iemand daarmee te confronteren.
Komt dus vanuit 'madCollection' vandaar ik nu een extra Try gedaan hebt. Scheelt gedoe maar lost het niet op denk ik.
Bedankt alvast.
Groetjes,
Eduard.
Bookmarks