Forum > WinCE

path finding

(1/2) > >>

I created a small application which is running a dataset. this dataset will  be saved as a textfile.
When I using 'assign(F,'sample.txt') and my application runs on temp in wince, my file is saved in the root. But why? How do I find the temp directory or my documents or application directory on winCE with Lazarus?


--- Code: ---function AppFolder:String;
  Result := ExtractFileDir(Application.ExeName);

--- End code ---
That should work on all windows systems.

GetTempDir doesn't look like it's got any OS specific calls (just requires Environment TEMP being defined...)

winCE is not window specific. It doesn't use drive letters to combine. The Environment TEMP doesn't exists, because I created myself.
winCE has 4 mountpoints
- /
- application
- my documents
- windows (i'm not sure about this one, device is at the office)

I could try extractfiledir(), but that doesn't give me (for example) My documents\textfiles to copy the file into

I think WinCE doesn't know the concept of "Working directory" so if you save a file without specifying the full path it won't end up in your "Program directory". (It's somewhere in here)

Could you try getting the full program-filename and derive the path to put before sample.txt?

--- Code: ---var
  lpFileName: array[MAX_PATH+1] of Char;
  GetModuleFileName(NULL, lpFileName, MAX_PATH);

--- End code ---


[0] Message Index

[#] Next page

Go to full version