access violation when posting an event from a thread

Vadim Zeitlin vadim at wxwidgets.org
Wed Apr 30 14:15:10 PDT 2008


On Wed, 30 Apr 2008 18:56:33 +0200 Thomas Zehbe <tz at thomas-zehbe.de> wrote:

TZ> I'm running 2.8.7 on windows in unicode mode. I have an app running a thread, 
TZ> which reads from the serial line and sends data to the app via
TZ>                     wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, 
TZ> SAM_EVENT );
TZ>                     event.SetClientData((void*)buf);
TZ>                     wxPostEvent(win, event);
TZ> where win is a pointer to a frame.
TZ> 
TZ> The stack dump is:
TZ> 
TZ> wxWindow::GetHWND() line 156 + 10 bytes
TZ> wxApp::WakeUpIdle() line 545 + 14 bytes

 If it crashes in GetHWND() the window pointer (this is not the "win" above
but the pointer returned by wxApp::GetTopWindow() from looking at
WakeUpIdle() code) must be bad. Maybe the frame was closed in the meanwhile
or something like that?

 Regards,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/



More information about the wx-users mailing list