Page 1 of 1

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

Posted: Tue Aug 21, 2018 7:25 am
by shawnee
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!

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

Posted: Tue Aug 21, 2018 7:30 am
by PB
You are missing a theme manifest for common controls. For more information, see e.g. WXWIN/docs/msw/winxp.txt

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

Posted: Tue Aug 21, 2018 8:24 am
by shawnee
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.

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

Posted: Tue Aug 21, 2018 8:49 am
by PB
Why did you not do what the document I linked suggests? I.e., include the wxWidgets resource file in yours

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

Posted: Tue Aug 21, 2018 8:56 am
by shawnee
Thank you PB!
I got this prompt: fatal error RC1015: cannot open include file 'wx/msw/rcdefs.h'

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

Posted: Tue Aug 21, 2018 9:02 am
by shawnee
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...

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

Posted: Tue Aug 21, 2018 10:31 am
by PB
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...

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

Posted: Tue Aug 21, 2018 12:30 pm
by shawnee
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.

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

Posted: Tue Aug 21, 2018 12:37 pm
by PB
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.

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

Posted: Wed Aug 22, 2018 1:53 am
by shawnee
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!