access violation in release mode
-
morning, this app works fine in debug but crash on release mode with access violation. I have tried to turn optimazation to default, still no luck. it's a motithreading app, anybody got experience about this? here is the call stack when it crash: USER32! 77e338b0() CDialog::EndDialog(CDialog * const 0x00000000 {CDialog hWnd=???}, int 2) line 580 + 13 bytes CDialog::OnCancel(CDialog * const 0x00000000 {CDialog hWnd=???}) line 709 CSurchrgDlg::Exit() line 270 Run(void * 0x0012f75c) line 310 _AfxThreadEntry(void * 0x0012f280) line 112 + 5 bytes ADDSURCHRG! _beginthreadex + 202 bytes KERNEL32! 7c57b388()
-
morning, this app works fine in debug but crash on release mode with access violation. I have tried to turn optimazation to default, still no luck. it's a motithreading app, anybody got experience about this? here is the call stack when it crash: USER32! 77e338b0() CDialog::EndDialog(CDialog * const 0x00000000 {CDialog hWnd=???}, int 2) line 580 + 13 bytes CDialog::OnCancel(CDialog * const 0x00000000 {CDialog hWnd=???}) line 709 CSurchrgDlg::Exit() line 270 Run(void * 0x0012f75c) line 310 _AfxThreadEntry(void * 0x0012f280) line 112 + 5 bytes ADDSURCHRG! _beginthreadex + 202 bytes KERNEL32! 7c57b388()
simply put, you window is not valid when it was closed. Yes, these kind of problems are quite common in VC++ w.r.t apps running in Debug and not working on Release. Since you need to take care while multithreading in MFC, I do notknow how the you have created the window, which thread own/created the window. Does that thread has its own message loop, etc ,etc.
-prakash
-
morning, this app works fine in debug but crash on release mode with access violation. I have tried to turn optimazation to default, still no luck. it's a motithreading app, anybody got experience about this? here is the call stack when it crash: USER32! 77e338b0() CDialog::EndDialog(CDialog * const 0x00000000 {CDialog hWnd=???}, int 2) line 580 + 13 bytes CDialog::OnCancel(CDialog * const 0x00000000 {CDialog hWnd=???}) line 709 CSurchrgDlg::Exit() line 270 Run(void * 0x0012f75c) line 310 _AfxThreadEntry(void * 0x0012f280) line 112 + 5 bytes ADDSURCHRG! _beginthreadex + 202 bytes KERNEL32! 7c57b388()
-
simply put, you window is not valid when it was closed. Yes, these kind of problems are quite common in VC++ w.r.t apps running in Debug and not working on Release. Since you need to take care while multithreading in MFC, I do notknow how the you have created the window, which thread own/created the window. Does that thread has its own message loop, etc ,etc.
-prakash
Thank you for the reply here is part of the dialog window: BOOL CSurchrgApp::InitInstance() { ..... CSurchrgDlg dlg; m_pMainWnd = &dlg; dlg.DoModal(); } when I set breakpoint at dlg.DoModal(); I would get the &dlg, dlg and m_pMainWnd with {CSurchrgDlghWnd=0x0000000}, but this seems like the standard coding, not sure why it's getting all the 00000000......