GetUserFilePath
Note The main application case for this function is to forward the path of a registered user file to a CAPL DLL in case of adistributed environment. The function is, however, also available in a single PC setup.
Syntax
long getUserFilePath(char fileName[], char absPath[], long absPathLen)
Function
Gets the absolute path of auser file. In case of execution in a distributed environment the absolute user file path (including file name) on the remote device (e.g. VN8900) is returned if the user file was pre-defined. If the file was not pre-defined an error code is returned. In case of a single PC environment the registered absolute file path (including file name) of the user file is returned if the user file was pre-defined. If the file was not pre-defined the function returns the same result asgetAbsFilePath(converting a path relative to the configuration directory to an absolute path).
Parameters
fileName A file name potentially containing a path. If the file name is pre-defined the path is ignored. Otherwise the path is interpreted as relative to the current configuration path in a single PC environment.
absPath
Buffer to which the full path name should be copied.
absPathLen
Size of the buffer [in bytes] for the full path name.
Return Values
On success this function returns the length of the full path name. Otherwise the function returns -1 if parameters do not fit or buffer size is too small or -2 if no user file with the given name was registered in case of a distributed environment.
on preStart{char absPath[256];VgetUserFilePath("MyCAPLDll.INI", absPath, 256);MyCAPLDllFunction(absPath);}
RegisterUserFile