if call wx GUI from dll, the style of GUI would be not WIN10 native style

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
shawnee
Experienced Solver
Experienced Solver
Posts: 52
Joined: Tue Jan 16, 2018 1:05 am

if call wx GUI from dll, the style of GUI would be not WIN10 native style

Post by shawnee » Tue Aug 21, 2018 7:25 am

I built two projects in Windows. One is the program entry project, the other is a dll project.
In entry project, it's just WinMain entry. All of wxWidgets GUI issues(wxApp, wxFrame,etc.) will be done in dll project.
I found, the appearance of widget, such as wxChoice, wxRadioButton and wxTextCtrl are not WIN10 native style.
For WIN10 native style, these widgets should be flat with thin border, but now, for example, wxChoice and wxTextCtrl have a thick border.

Is there somebody tell me what's wrong with it? Thanks!

PB
Part Of The Furniture
Part Of The Furniture
Posts: 1881
Joined: Sun Jan 03, 2010 5:45 pm

Re: if call wx GUI from dll, the style of GUI would be not WIN10 native style

Post by PB » Tue Aug 21, 2018 7:30 am

You are missing a theme manifest for common controls. For more information, see e.g. WXWIN/docs/msw/winxp.txt

shawnee
Experienced Solver
Experienced Solver
Posts: 52
Joined: Tue Jan 16, 2018 1:05 am

Re: if call wx GUI from dll, the style of GUI would be not WIN10 native style

Post by shawnee » Tue Aug 21, 2018 8:24 am

Thanks PB!
I make a manifest copied from winxp.txt, and reside the folder where is as same as my application.
It seems not solve the problem.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 1881
Joined: Sun Jan 03, 2010 5:45 pm

Re: if call wx GUI from dll, the style of GUI would be not WIN10 native style

Post by PB » Tue Aug 21, 2018 8:49 am

Why did you not do what the document I linked suggests? I.e., include the wxWidgets resource file in yours

shawnee
Experienced Solver
Experienced Solver
Posts: 52
Joined: Tue Jan 16, 2018 1:05 am

Re: if call wx GUI from dll, the style of GUI would be not WIN10 native style

Post by shawnee » Tue Aug 21, 2018 8:56 am

Thank you PB!
I got this prompt: fatal error RC1015: cannot open include file 'wx/msw/rcdefs.h'

shawnee
Experienced Solver
Experienced Solver
Posts: 52
Joined: Tue Jan 16, 2018 1:05 am

Re: if call wx GUI from dll, the style of GUI would be not WIN10 native style

Post by shawnee » Tue Aug 21, 2018 9:02 am

If load wx GUI not from dll project, just from main(.exe) project, the style is WIN10 style.
But I didn't add any rc or manifest to main project. I'm confused...

PB
Part Of The Furniture
Part Of The Furniture
Posts: 1881
Joined: Sun Jan 03, 2010 5:45 pm

Re: if call wx GUI from dll, the style of GUI would be not WIN10 native style

Post by PB » Tue Aug 21, 2018 10:31 am

shawnee wrote:I got this prompt: fatal error RC1015: cannot open include file 'wx/msw/rcdefs.h'
Did you add the required path (WXWIN\include) to the include directories for resource compiler?

What compiler/linker are you using? MSVC adds the manifest automatically by default...

shawnee
Experienced Solver
Experienced Solver
Posts: 52
Joined: Tue Jan 16, 2018 1:05 am

Re: if call wx GUI from dll, the style of GUI would be not WIN10 native style

Post by shawnee » Tue Aug 21, 2018 12:30 pm

PB wrote:
shawnee wrote:I got this prompt: fatal error RC1015: cannot open include file 'wx/msw/rcdefs.h'
Did you add the required path (WXWIN\include) to the include directories for resource compiler?

What compiler/linker are you using? MSVC adds the manifest automatically by default...
I'm using vs2015. Including path(c/c++ -> Gerneral -> Additional Include Directories ) about wxWidgets has been set.
If I move GUI code into main project from dll project, the style is WIN10 style. It's so strange.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 1881
Joined: Sun Jan 03, 2010 5:45 pm

Re: if call wx GUI from dll, the style of GUI would be not WIN10 native style

Post by PB » Tue Aug 21, 2018 12:37 pm

shawnee wrote:I'm using vs2015. Including path(c/c++ -> Gerneral -> Additional Include Directories ) about wxWidgets has been set.
Are you sure this is the correct setting. These are for C++ compiler, not the resource one which are in Resources -> General -> Additional Include Directories. The setting is available only when the project includes at least one resource (.rc) file.

But as I wrote above, MSVC 2015 adds the required manifest by default (see Manifest Tool properties) in the project properties.

shawnee
Experienced Solver
Experienced Solver
Posts: 52
Joined: Tue Jan 16, 2018 1:05 am

Re: if call wx GUI from dll, the style of GUI would be not WIN10 native style

Post by shawnee » Wed Aug 22, 2018 1:53 am

PB wrote:
shawnee wrote:I'm using vs2015. Including path(c/c++ -> Gerneral -> Additional Include Directories ) about wxWidgets has been set.
Are you sure this is the correct setting. These are for C++ compiler, not the resource one which are in Resources -> General -> Additional Include Directories. The setting is available only when the project includes at least one resource (.rc) file.

But as I wrote above, MSVC 2015 adds the required manifest by default (see Manifest Tool properties) in the project properties.
PB,
I solved this problem after I embeded a manifest file into main project (Manifest Tool -> Input and Output -> Additional Manifest Files).

Below is this file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="0.64.1.0"
processorArchitecture="amd64"
name="Controls"
type="win32"
/>
<description>wxWindows application</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="amd64"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

Thank you so much!

Post Reply