-
Unhandled exception
When I try to end my program, which is written in VC++6.0 and runs on WinXP,
I get an error message "Unhandled exception with my.exe (NTDLL.DLL). Access
violation." My code is like this:
case WM_DESTROY:
Code:
{
// tell the rendering loop to terminate itself
EnterCriticalSection(&csThreadSafe);
rsRenderData.bTerminate = TRUE;
rsRenderData.bModifyFlag = TRUE;
LeaveCriticalSection(&csThreadSafe);
WaitForSingleObject(hThreadHandle, 5000);
DeleteCriticalSection(&csThreadSafe);
delete pScene;
glDeleteLists(nFontList, 12;
// shut down OpenGL Rendering context
wglMakeCurrent(hDC, 0);
wglDeleteContext(hRC);
ReleaseDC(hWnd, hDC);
PostQuitMessage(0);
}
Can anyone give me some suggestion what might be the problem?
Thanks
-
Re: Unhandled exception
I suggest that you try a debugger, if that doesn't help then try removing
code until you eliminate the problem, that should give you a clue as to
which line is causing the problem. If you are still stuck ask in a Windows
programming group such as comp.os.ms-windows.programmer.win32.
-
Re: Unhandled exception
The first problem is that you're asking about this in the wrong place. We only discuss ISO standard C++
The place to ask about Windows programming issues is newsgroup comp.os.ms-windows.programmer.win32
-
Re: Unhandled exception
i got the answer
as i faced the same access violation problem
at EnetrCriticalSection(&urobject)
u created object its nice but .., u did EnterCriticalSection(&urobject);
without initialising the object for the critical section
u have to do InitializeCriticalSection(&urObject);
i.e..,
CRITICAL_SECTION urobject;
InitializeCriticalSection(&urObject);
EnterCriticalSection(&urobject);
Page generated in 1,714,109,206.84383 seconds with 10 queries