Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. access violation in release mode

access violation in release mode

Scheduled Pinned Locked Moved C / C++ / MFC
data-structuresdebuggingquestionannouncement
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    valerie99
    wrote on last edited by
    #1

    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()

    P N 2 Replies Last reply
    0
    • V valerie99

      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()

      P Offline
      P Offline
      Prakash Nadar
      wrote on last edited by
      #2

      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

      V 1 Reply Last reply
      0
      • V valerie99

        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()

        N Offline
        N Offline
        Nynaeve
        wrote on last edited by
        #3

        See http://www.codeproject.com/debug/survivereleasever.asp

        1 Reply Last reply
        0
        • P Prakash Nadar

          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

          V Offline
          V Offline
          valerie99
          wrote on last edited by
          #4

          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......

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups