[fpc-pascal] ExtractFilePath(GetModuleName(0)) problem

lloyd thomas lloydie.t at googlemail.com
Sat Apr 11 02:21:03 CEST 2009


Need Help please "confini :=
ExtractFilePath(GetModuleName(0))+'\myfile.ini';" returns C:Program
FilesMyApp\myfile.ini should be C:\Program Files\MyApp\myfile.ini . Am I
doing something wrong?

The Problem is intermitent

    {$IFDEF Windows}
confini  := ExtractFilePath(GetModuleName(0))+'\Myfile.ini';
{$ENDIF}
{$IFDEF Linux}
confini  := GetAppConfigDir(True)+'/callcollex.conf';
{$ENDIF}

   IniFile := TIniFile.Create(confini);

returns  an  error as follows
project raised exception class 'EFopenError' with message:
Unable to open file "C:Program FilesMyApp\myfile.ini"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20090411/310c97c6/attachment.html>


More information about the fpc-pascal mailing list