Error:
An unhandled exception of type 'System.AccessViolationException' occurred in Unknown Module.
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
The execution breaks at one of these places:
1. file name oleinit.cpp
Expand|Select|Wrap|Line Numbers
- if (pThread != NULL)
- {
- // destroy message filter (may be derived class)
- delete pThread->m_pMessageFilter;
- pThread->m_pMessageFilter = NULL; // This is the line where execution breaks
- }
Expand|Select|Wrap|Line Numbers
- CCmdTarget::~CCmdTarget()
- {
- #ifndef _AFX_NO_OLE_SUPPORT
- if (m_xDispatch.m_vtbl != 0)
- ((COleDispatchImpl*)&m_xDispatch)->Disconnect(); //This is the line where error is indicated
- ASSERT(m_dwRef <= 1);
- #endif
- m_pModuleState = NULL;
- }
The same doesnot happen when i execute the program in debug mode. Also when i execute the program throught the executable the exiting doesnot give this error. Can someone please help.