I've tried the the second solution from the very beginning. The error is now that i got a short string instead of pChar. I've tried this solution, but it had the same result.
Code:
path:=pChar(ExtractFilePath('grafica.exe'));
EDIT: The fact is that i just realise that by writing the upper instruction, the path variable is empty. Only if you write the whole path it is kept in the variable, the problem i want to avoid. In the problem with the short-string to pChar, i solved, the problem is this thing now. Getting the file path, without writing the whole path
If i write
Code:
path:=pChar(ExtractFilePath('C:\Pascal\Projects\grafica.exe');
the variable will keep C:\Pascal\Projects\, otherwise it will be empty.
Bookmarks