when the program is closed, why does the exception occur?
-
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?
-
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?
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/[^]