1. Robert Carlson
  2. PowerBuilder
  3. Monday, 9 January 2023 22:20 PM UTC

Hello all.

We recently updated our software to use the new PB UI themes. Our customers haven't had any problems with this working in production, except for one group of customers who are using Windows Server 2016 to host , and RDS to connect to the application. We have several other customers who are using a similar setup with Windows Server 2012, and have not experienced any issues. Things we have tried.

1. We have made sure that the 'Windows Classic' setting was not set on the server

2. The path to the 'themes' folder is correct. It is located as a sub-folder in the application directory.

3. We have tried different ways to access themes using the ApplyTheme function. Absolute path, relative path, or just the theme name.

4. The pbtheme.dll and pbjson.dll are in the application directory as well.

5. Double checked Windows security permissions on the 'themes' folder. Doesn't work even if 'Full Control' is selected.

6. Tried moving the 'themes' folder somewhere else on the machine and calling the ApplyTheme function using the absolute path.

No matter what we try, the ApplyTheme function always returns -1 in this environment. The same exact code, with the same exact install (we literally copy pasted the program files folder from one machine to the other), returns 1 in other environments, and -1 in this Windows Server 2016 environment. We are not sure what else to try. Please help!

Some more details:

We are using PB 2019 R3 Build 2703 to create the application.

Here is some code I have tried using to debug this.

string ls_error, ls_path

ls_path = "C:\Program Files\SMART Systems\SMART\themes\Flat Design eR" // Path to the themes folder
MessageBox("Theme Path", ls_path)
MessageBox("Path Exists", FileExists(ls_path)) // Returns TRUE
MessageBox("Apply Theme 1", string(ApplyTheme(ls_path))) // Returns -1
MessageBox("Apply Theme 2", string(ApplyTheme("Flat Design eR"))) // Returns -1

Accepted Answer
Robert Carlson Accepted Answer Pending Moderation
  1. Tuesday, 31 January 2023 22:41 PM UTC
  2. PowerBuilder
  3. # Permalink

If anyone is interested the issue ended up being that the compatibility option for Windows Server 2008 was checked in the properties of the application EXE. After this was unchecked the themes started working for them.

There are no comments made yet.
Robert Carlson Accepted Answer Pending Moderation
  1. Wednesday, 11 January 2023 14:34 PM UTC
  2. PowerBuilder
  3. # 1

Hi Kitty,

This is what I got back from the customer. It is working on one of their test machines, but it is not working on all 3 of their production servers (maybe there is some system setting that is causing the issue?). All servers are running the same version of Windows Server 2016: version 10.0.14393 Build 14393.

  1. Miguel Leeuwe
  2. Wednesday, 11 January 2023 18:12 PM UTC
Could it be they might have to install some .Net framework runtime or C++ runtime? (just a shot in the dark).
  1. Helpful
There are no comments made yet.
kitty he @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 11 January 2023 05:50 AM UTC
  2. PowerBuilder
  3. # 2

Hi Robert,


I tested on Server 2016 version 1607 (OS Build 14393.0) but didn't reproduce the issue. I want to know if you have the issue on all Server 2016 machines or just a particular machine. Please let us know the version number of the OS in question (detailed version including the minor version number)




There are no comments made yet.
Robert Carlson Accepted Answer Pending Moderation
  1. Tuesday, 10 January 2023 13:57 PM UTC
  2. PowerBuilder
  3. # 3

Hello Chris,

1. The "Themes" folder is located underneath where the App's EXE is located

2. Themes are set to 'Do Not Use' in the Application object, as we are turning them on later at runtime

3. ApplyTheme("Flat Design eR") works just fine for all other installations, except for our customers who have it installed on Windows Server 2016.

The Themes are working without any problems for all of our customers (those on Windows 10/11, or on Windows Server 2012 over RDS), except this one customer who is installing on Server 2016. The installations are identical in all instances.

  1. Chris Pollach @Appeon
  2. Wednesday, 11 January 2023 18:30 PM UTC
Hi Robert;

Thank you for confirming the Theme set-up & use. That seems very good!

Sounds like a W0216 issue maybe. Please open a Support Ticket for this issue then.

Regards ... Chris
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 9 January 2023 22:55 PM UTC
  2. PowerBuilder
  3. # 4

Hi Robert;

  1. The "Themes" folder should be located underneath where the App's EXE is located (or, under the workspace for the IDE).
  2. The Application Object's theme path should be set to ".\themes"
  3. The apply theme should then just be - ApplyTheme ( "Flat Design eR" ) 


Regards ... Chris 

There are no comments made yet.
  • Page :
  • 1

There are no replies made for this question yet.
However, you are not allowed to reply to this question.