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. when the program is closed, why does the exception occur?

when the program is closed, why does the exception occur?

Scheduled Pinned Locked Moved C / C++ / MFC
questiondebuggingannouncement
2 Posts 2 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.
  • L Offline
    L Offline
    liuyue
    wrote on last edited by
    #1

    i debug my program in VC6.0. when it is closed, the exception "First-chance exception in F863.exe: 0xC0000005: Access Violation." will appear. and the cursor points to m_pInterface->Release().here are some codes: void _Release() throw() { if (m_pInterface != NULL) { m_pInterface->Release(); } } i define the variant:IApplicationPtr m_Application, and i find the exception occured in m_Application->Release(). here are some codes: int CF863App::ExitInstance() { if (m_Application != 0) m_Application->Release(); return CWinApp::ExitInstance(); } how can i resolve it?

    J 1 Reply Last reply
    0
    • L liuyue

      i debug my program in VC6.0. when it is closed, the exception "First-chance exception in F863.exe: 0xC0000005: Access Violation." will appear. and the cursor points to m_pInterface->Release().here are some codes: void _Release() throw() { if (m_pInterface != NULL) { m_pInterface->Release(); } } i define the variant:IApplicationPtr m_Application, and i find the exception occured in m_Application->Release(). here are some codes: int CF863App::ExitInstance() { if (m_Application != 0) m_Application->Release(); return CWinApp::ExitInstance(); } how can i resolve it?

      J Offline
      J Offline
      Jose Lamas Rios
      wrote on last edited by
      #2

      Some possible causes: a) You didn't initialize m_Application to NULL. b) You are trying to release it more than it's neeeded. c) Something else :) Maybe if you showed where you initialize (or assign) m_Application, and explain what else you do with it... -- jlr http://jlamas.blogspot.com/[^]

      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