#19088: CommDlgExtendedError() returns 0xffff for a DLL GUI
-------------------------------------+-------------------------
Reporter: sparhawk | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxMSW | Version: dev-latest
Keywords: CommonDialog fontpicker | Blocked By:
Blocking: | Patch: 0
-------------------------------------+-------------------------
I have a project which is loaded via a DLL from some non wxWidgets
application, using LoadLibrary() and GetProcaddress() to start the
application. I can open my MainFrame and use it, the only thing that is
not working is to use the wxFontPickerCtrl, or any other controls using
the CommonDialogs from Windows.
I have been using wxWidgets 3.1.4, built from source, as well, as running
the latest git version. I tested this with the DLL sample project, and
code reproduce the behavior there as well.
When I build the source using CMake, the DLL sample starts working, but
not when using the Visual Studion solution/project files. Consequently I
don't know what to set in my own project,as this is a normal Visual Studio
project.
I'm running Visual Studio 2019 Community Edition (latest version).
For a detailed discussion how to reproduce it I opened a thread on
https://forums.wxwidgets.org/viewtopic.php?f=1&t=48099
The window hierarchy looks like this (in the DLL):
wxFrame -> wxDialog(Modal) -> wxPanel -> wxFontPickerCtrl -> FontDlg
Steps to reproduce:
Extend wxWidgets/sample/my_dll.cpp with:
#include <wx/fontpicker.h>
And line 109:
sizer->Add
(
new wxFontPickerCtrl(p, wxID_ANY),
wxSizerFlags(0).Right().Border(wxALL, 10)
);
1. Downloaded the sources
2. Start VC 2019 Community, latest update.
3. Load solution from wxWidgets\build\msw\wx_vc16.sln
4. Build x64/Win32/Release/Debug
Exit VS 2019
5. Start VS 2019
6. Load Project file: wxWidgets\samples\dll\dll_vc9_my_dll.vcproj
6a. Apply above mentioned changes in my_dll.cpp.
7. Build x64/Debug
8. Load Project file: dll\dll_vc9_sdk_exe.vcproj
9. Build x64/Debug
10. Run it, doesn't work.
11. Load Project file: wxWidgets\samples\dll\dll_vc9_wx_exe.vcproj
12 Build x64/Debug
13. Run it. Works.
The same problem also shows in all build configurations, not just
x64/Debug.
--
Ticket URL: <
https://trac.wxwidgets.org/ticket/19088>