Bug 2901

PB 2019-2082 - ApplyTheme returns error in Win10Enterprice and Windoes Server 2012R2 20 November, 2020

Kari Paukku
18 June, 2019
Product: PowerBuilder Category: Controls & UI
Version: 2019 Build:
Classification: Publishing: Public
Priority: P2
Status: Verifying Reason:
Ken Guo @Appeon 20 November, 2020
Hi Kari,

I would like to check with you if the response provided has been helpful enough
to resolve your case. If so, can we proceed to close the ticket?

Ken Guo @Appeon 20 June, 2019
Hi Kari,

Thank you for letting us know.
Can we close this ticket ?

Kari Paukku 19 June, 2019
the problem turned out to be two missing runtime files when implemented outside the development environment. For the record, the files were  pbjson190.dll and pbtheme190.dll.

Including those made the themes appear both in Win 10 Ent and Win2012R2 environment.

Thank you all for your help.
Ken Guo @Appeon 19 June, 2019
Hi Kari,

During the meeting, I used a small case to test on your machine and it works well. And then I copied your app to the Windows 10 Enterprise machine again and it works fine too.

Thus, please compare my folder with your previous folder and check the differences between them (focus on the difference in the PBD/EXE files). Please use the latest PBD/EXE files.

Ken Guo @Appeon 19 June, 2019
Hi Kari,

If you are available between 15:10-16:00 Hong Kong Time (Finland Time 10:10-11:00), please join this meeting:

Kari Paukku 19 June, 2019
thank you for your prompt reply. To answer your points

1. Yes, the application runs ok from the PB IDE and as .EXE, in the development pc (Win 10 Pro). The ApplyTheme uses relative path - the themes are in a subfolder "theme190" where the .EXE is.

2. deployed the application to the development PC (Win10 Pro) and a Virtual Machine (Win10 Ent) . Windows Classic Style’ is not chceked

3. Done
4. The theme in the virtual machine is Windows 10 - I didnt find anything related to "Classic"
5. In Win10 Ent - version 1903, build 18362.145 I didnt find where to do this.

To summarise, in development environment the ApplyTheme("Flat Design Blue") works both from PB IDE and the .EXE file.
When I copy from the development PC the folder where the application has been implemented into the virtual machine (WinEnt) it doesnt work. Same when copying to WinServer2012R2

I have tried to apply different scaling, resolution etc. in the virtual machine, but it hasnt changed anything.

So yes, if you are able to have a short session with me to resolve this, that would be great.

Ken Guo @Appeon 18 June, 2019
Hi Kari,

Windows 10 Enterprise and Windows 2012 R2 both support the New UI Theme feature. 
We suggest that you check the following:
1. Make sure your application runs correctly with the ApplyTheme function on PB IDE. And we also suggest that you use relative path for ApplyTheme, such as ApplyTheme(‘Flat Design Blue’).
2. Deploy your application as exe on PB IDE. Make sure not to check ‘Windows Classic Style’ for your project object. 
3. Copy Theme190 folder to the folder where you put your application exe file. 
4. If the Windows system theme is set to "Windows Classic", then the application UI will be rendered in the Windows Classic theme instead of the selected theme.
5. If the scaling percentage is set to 125% or lower, the "Use Windows XP style DPI scaling" option will be automatically selected, which will prevent the selected theme working correctly. In such case (125% or lower), you should manually uncheck the "Use Windows XP style DPI scaling" option.

If you still have any issue, we can schedule for a meeting. 

Kari Paukku 18 June, 2019
In the text  "Made a button that call the ApplyTime function as follows", "ApplyTime"  should be ApplyTheme
Kari Paukku 18 June, 2019
ApplyTheme returns error in Win10 and WindowsServer 2012R2 environment. Win 10 Pro is ok.

*Reproduce Steps:
1) copied the themes to C:\TEMP\themes and into that, the four theme folders provided by Appeon, e.g Flat Design Blue 

2) Made a button that call the ApplyTime function as follows

int rc
String s

rc = ApplyTheme("C:\temp\themes\Flat Design Blue")
messagebox("rc", rc)

s = GetTheme()
messagebox("Theme is", s)

Under Win10 Pro it works ok, return value is 1 and theme name is Flat Design Blue

Under Win 10 Ent and Windosw 2012R2 (which acts as a Terminal Server)the same code returns -1 and no template name.

Have tried all kind of combinations, e.g. having the theme files as subfolders (with different names: Theme, Themes, Theme180,189 etc) where the application is installed. In Win10Ent and WinServer2012R2 no approach has worked
Windows 10
Database Type:
Database Version: