Segmentation fault when creating wxChoice from a DLL in Windows.
Posted: Fri Jan 24, 2020 7:23 pm
Hi everyone,
I get a segmentation fault when instanciating a wxChoice in Windows from a DLL. It works well when I put the code directly into the host app. It also works from a shared library in linux, the problem is only in Windows.
When I debug it, the problem is located inside choice.cpp at the line 177
Going down inside GetTopWindow, I can see that GetInstance() from app.h returns 0x0, hence the segmentation fault.
About my config:
I use multiple DLL for wxWidgets.
wxWidgets`s version is 3.1.3
My custom dll uses a .DEF file so I haven't used any macro to define __declspec(dllexport)
Anyone got an idea?
Thanks,
I get a segmentation fault when instanciating a wxChoice in Windows from a DLL. It works well when I put the code directly into the host app. It also works from a shared library in linux, the problem is only in Windows.
When I debug it, the problem is located inside choice.cpp at the line 177
Code: Select all
// FIXME: Use better dummy window?
wxWindow* wnd = wxTheApp->GetTopWindow();
Code: Select all
static wxAppConsole *GetInstance() { return ms_appInstance; }
I use multiple DLL for wxWidgets.
wxWidgets`s version is 3.1.3
My custom dll uses a .DEF file so I haven't used any macro to define __declspec(dllexport)
Anyone got an idea?
Thanks,