Sorry, there were busy weeks.
Is you application using LCL or LazUtil
No, it isn't. I'm not using GUI.
Can you show us the relevant part of the code and exactly at what line it fails?
I suppose you use False for the "Global" paramater of GetAppConfigDir?
I use GetAppConfigFile instead:
fFileName := GetAppConfigFile (FALSE);
Then, I use it to create the directory and the file:
(* Saves changes. *)
PROCEDURE TmngConfiguration.Save;
VAR
DirPath: STRING;
BEGIN
{ Be sure the directory exists. }
DirPath := ExtractFileDir (fFileName);
IF NOT DirectoryExists (DirPath) THEN
IF NOT CreateDir (DirPath) THEN
{ Changed this to avoid problems with bad encoded file names
(i.e. Windows). Now just put it down in to the log file.
RAISE mngConfigException.CreateFmt (COULDNT_SAVE_CFG_FILE, [fFileName]);
}
mngApplication.LogFmt (etWarning, COULDNT_SAVE_CFG_FILE, [fFileName]);
{ Save the file. }
IF NOT al_save_config_file (fFileName, fConfig) THEN
{ See previous long comment.
RAISE mngConfigException.CreateFmt (COULDNT_SAVE_CFG_FILE, [fFileName]);
}
mngApplication.LogFmt (etWarning, COULDNT_SAVE_CFG_FILE, [fFileName]);
{ Event. }
fOnSave.Notify
END;
As I've said, it creates the directory but fails creating the file.
al_save_config_file is from
Allegro.
I had a similar problem before. I think it was solved with the following.
procedure TForm1.Button1Click(Sender: TObject);
var
fname:UTF8String='C:\Users\mali.aydin\Desktop\Türkçe\ĞÜŞİÖÇ.txt';
begin
// UTF8ToISO_8859_1 uses add LConvEncoding.;
ExecuteProcess('explorer.exe', '/select,'+PChar(UTF8ToISO_8859_1(fname)), []);
end;
I'll see how I can use that UTF8ToISO_8859_1.
Anyway what if it is installed in a non-western computer (for example Japan)?
Maybe wait until Ñuño_Martínez replies, otherwise it's just guess work.
Bart
My bad. As I've said it were busy weeks.
I must say that I don't care to be compatible with older than Windows 7 (at themoment).
Also, the program creates the file in my own Win7 computer and in two Win10 computer I have access to: I have limited access to one that fails.