Sers, ich mal wieder
hier der Code:
Delphi-Quelltext
1: 2:
| ProgrammOrdner := GetSpecialFolder(Handle, CSIDL_PERSONAL) + '\FarmiRechner 5.0\Produkte.ini'; Ini := TIniFile.Create(ProgrammOrdner); |
Hier der Code zur Funktion:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24:
| function GetSpecialFolder(hWindow: HWND; Folder: Integer): String; var pMalloc: IMalloc; pidl: PItemIDList; Path: PChar; begin if (SHGetMalloc(pMalloc) <> S_OK) then begin MessageBox(hWindow, 'Couldn''t get pointer to IMalloc interface.', 'SHGetMalloc(pMalloc)', 16); Exit; end;
SHGetSpecialFolderLocation(hWindow, Folder, pidl); GetMem(Path, MAX_PATH); SHGetPathFromIDList(pidl, Path); Result := Path; FreeMem(Path);
pMalloc.Free(pidl); end; |
aber ich bekomme folgende Fehlermeldung:
First chance exception at $7660B727. Exception class EIniFileException with message 'Unable to write to C:\Users\<Benutzer>\Documents\<MeinProgramm>\Produkte.ini'. Process <MeinProgramm>.exe (3568)
Kann mir jemand sagen was da falsch is??
Gruß
Moderiert von
Narses: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am So 11.04.2010 um 23:00