[code
..\MyApplication\App.exe
\MyApplication\Data\file001.dat
[/code
To get the current direcory i used:
Code: Select all
Global currentDir.s = Space(#MAX_PATH)
GetCurrentDirectory_(255,@currentDir.s)
...
The path for loading the files looks something like: Load( currentDir.s + "\Data\File001.dat")
I added the path and its executeable filename to the AutoRuns entry in the registry, so the application will be started directly at booting / starting the system.
The application is running but it does not find any datafiles and currentDir.s returns an incorrect path, which shows always: "c:\windows\system32\"

So i tried another next code to get the correct path to get the application work - even with autorun.
Code: Select all
currentDir.s = Space(#MAX_PATH)
GetModuleFileName_(0,@currentDir.s, 255)