Crash in wxDialog::Create()

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Wiggers
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Aug 23, 2006 9:23 am
Location: UK

Crash in wxDialog::Create()

Post by Wiggers »

I'm extracting some code from a program that uses wxWidgets for UI and sockets and making a DLL for use by other MFC programs. I managed to get everything to compile, but it crashed somewhere in hash.cpp when wxDialog::Create() was called. I tried recompiling wxWidgets with
#define wxUSE_STL 1
#define WXWIN_COMPATIBILITY_2_4 0

Now it crashes in wxHashTableBase::DoGet() where 'this' is NULL.

Code: Select all

harness.exe!wxHashTableBase::DoGet(long key=67110, long hash=67110)  Line 882 + 0x16	
harness.exe!wxWinHashTable::Get(long key=67110)  Line 581 + 0x1
harness.exe!wxFindWinFromHandle(void * hWnd=0x00010626)  Line 3036
harness.exe!wxAssociateWinWithHandle(HWND__ * hWnd=0x00010626, wxWindow * win=0x0091bd98)  Line 3045 + 0x9
harness.exe!wxWindow::SubclassWin(void * hWnd=0x00010626)  Line 1035 + 0xd
harness.exe!wxTopLevelWindowMSW::CreateDialog(const void * dlgTemplate=0x014619d0, const wxString & title={...}, const wxPoint & pos={...}, const wxSize & size={...})  Line 427
harness.exe!wxTopLevelWindowMSW::Create(wxWindow * parent=0x00000000, int id=11007, const wxString & title={...}, const wxPoint & pos={...}, const wxSize & size={...}, long style=537395201, const wxString & name={...})  Line 515 + 0x18
harness.exe!wxDialog::Create(wxWindow * parent=0x00000000, int id=11007, const wxString & title={...}, const wxPoint & pos={...}, const wxSize & size={...}, long style=537395201, const wxString & name={...})  Line 187 + 0x24
I have a very simple harness that simply calls an exported function from the DLL that has some global instances of the classes from the original program. I'm OR-ing the original style with wxDIALOG_NO_PARENT. The original style was just wxCAPTION.

Any ideas please?

Mark
KevinHock
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 236
Joined: Sat Sep 04, 2004 1:49 pm
Location: Ohio, USA
Contact:

Post by KevinHock »

It might help if you posted the code being used to create the Dialog, e.g. the dialog constructor or other relevant code.
Wiggers
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Aug 23, 2006 9:23 am
Location: UK

Post by Wiggers »

I gave up trying to get it to work after wasting nearly a week on it. I've dumped all the wxDialog stuff and replaced it with MFC. It seems wxDialogs don't like being in DLLs.

Mark
KevinHock
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 236
Joined: Sat Sep 04, 2004 1:49 pm
Location: Ohio, USA
Contact:

Post by KevinHock »

Or maybe they don't like being invoked from MFC. ;) Anyway, I'm sorry to hear that it didn't work out.
Wiggers
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Aug 23, 2006 9:23 am
Location: UK

Post by Wiggers »

Actually I hadn't done anything with MFC until I dumped the wxWidgets stuff! The harness was just plain, ordinary C code.
Post Reply