getPath() on Desktop UI returns an empty string

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
4 posts • Page 1 of 1
michel.eijgermans
Posts:46
Joined: Mon Aug 08, 2011 11:50 am

getPath() on Desktop UI returns an empty string

Post by michel.eijgermans »

LS,

WinCC-OA 3.15
Windows-7 SP1

In my application i like to read some configuration settings from configfile named "config_subsystem" which is located in the \\config directory.

To resolve the path of the config file I use
string sPath = getPath(CONFIG_REL_PATH,"config_subsystem");

I checked the file is in the directory!

Running this line of code on a normal UI then then sPath gets filled with the absolute path as expected.
Running this line of code from a Desktop-UI (on the same machine) which is connected to the project then sPath stay's empty.

I can't figure out what i'm missing here!

- Do i have to do an additional settings when running a Desktop-UI which is connected to a project running on the same machine?
- Does getPath have difficulties getting filenames from the config directory?

Best regards,
Michel.

Gertjan van Schijndel
Posts:634
Joined: Mon Aug 02, 2010 10:37 am

Re: getPath() on Desktop UI returns an empty string

Post by Gertjan van Schijndel »

The config directory is 'protected', files in this directory by default cannot by downloaded (by getPath). You would need to add a 'httpConnect' for these files.
Or move your files to for example to the data directory.

michel.eijgermans
Posts:46
Joined: Mon Aug 08, 2011 11:50 am

Re: getPath() on Desktop UI returns an empty string

Post by michel.eijgermans »

Gertjan, thx.
Then it makes sense that Stylesheet_dark/light isn't loaded as well :)

kilianvp
Posts:443
Joined: Fri Jan 16, 2015 10:29 am

Re: getPath() on Desktop UI returns an empty string

Post by kilianvp »

just name it "stylesheet.css" and your stylesheet will work!

they bypass the security by doing

Code: Select all

httpConnect("getTouchStyleSheet", "/config/touchscreen.css", "text/plain");
in webclient_http.ctl.

If it wont work for you dont have the lastest 3.15 Patch

4 posts • Page 1 of 1