0xC0000005:Acces violation
-
Can anyone explain me what I have to do with this error? 0xC0000005:Acces Violation The debugger stops at: //perform specific initializations if (!pThread->InitInstance()) { if(pThread->m_pMainWnd !=NULL) { TRACE0("Warning: Destroying non-NULL m_pMainWnd\n"); pThread->m_pMainWnd->DestroyWindow(); } nReturnCode=pThread->ExitInstance(); goto InitFailure; } nReturnCode = pThread ->Run(); The debugger stops at the line; pThread->m_pMainWnd->DestroyWindow(); Thanx, kind regards, Geert
-
Can anyone explain me what I have to do with this error? 0xC0000005:Acces Violation The debugger stops at: //perform specific initializations if (!pThread->InitInstance()) { if(pThread->m_pMainWnd !=NULL) { TRACE0("Warning: Destroying non-NULL m_pMainWnd\n"); pThread->m_pMainWnd->DestroyWindow(); } nReturnCode=pThread->ExitInstance(); goto InitFailure; } nReturnCode = pThread ->Run(); The debugger stops at the line; pThread->m_pMainWnd->DestroyWindow(); Thanx, kind regards, Geert
put a breakpoint before the line and see what it is returning..and what u were expecting..so you will know why it is happening.. I guess you are doing it wrong way..so it doesn't know anything such as window to be destroyed..try m_pmainWnd->destroywindow(); i hope this will work..;) cheers.. Himanshu
-
Can anyone explain me what I have to do with this error? 0xC0000005:Acces Violation The debugger stops at: //perform specific initializations if (!pThread->InitInstance()) { if(pThread->m_pMainWnd !=NULL) { TRACE0("Warning: Destroying non-NULL m_pMainWnd\n"); pThread->m_pMainWnd->DestroyWindow(); } nReturnCode=pThread->ExitInstance(); goto InitFailure; } nReturnCode = pThread ->Run(); The debugger stops at the line; pThread->m_pMainWnd->DestroyWindow(); Thanx, kind regards, Geert
Just a quick stab in the dark, but the fact that your UI Thread failed to initialised :
pThread->InitInstance() // returns false
.. would indicate that the handle to the thread's main window, pThread->m_pMainWnd, may not have been initialised. This would explain the memory violation when attempting to dopThread->m_pMainWnd->DestroyWindow();
. The fact that m_pMainWnd is not NULL is not an indication that it is a valid handle. .. ... and my golly god, did I see a goto statement at the end of your code? :omg: -
Just a quick stab in the dark, but the fact that your UI Thread failed to initialised :
pThread->InitInstance() // returns false
.. would indicate that the handle to the thread's main window, pThread->m_pMainWnd, may not have been initialised. This would explain the memory violation when attempting to dopThread->m_pMainWnd->DestroyWindow();
. The fact that m_pMainWnd is not NULL is not an indication that it is a valid handle. .. ... and my golly god, did I see a goto statement at the end of your code? :omg:Or you have not waited until it HAS initialised
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
-
Or you have not waited until it HAS initialised
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676