| Topic: |
DEVELOP > c-Plus-Plus |
| User: |
"Hilary Zhang" |
| Date: |
09 Feb 2004 12:18:32 AM |
| Object: |
Unhandled exception when ending a program |
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:
{
// 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, 128);
// 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.
.
|
|
| User: "John Harrison" |
|
| Title: Re: Unhandled exception when ending a program |
09 Feb 2004 12:32:15 AM |
|
|
"Hilary Zhang" <hzhang@sfu.ca> wrote in message
news:c078ni$mu4$1@morgoth.sfu.ca...
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:
[windows code snipped]
Can anyone give me some suggestion what might be the problem? Thanks.
No, not nearly enough information. In any case this is a C++ group not a
windows programming group.
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.
john
.
|
|
|
|
| User: "Mike Wahler" |
|
| Title: Re: [OT, welcome msg, redirect] Unhandled exception when ending a program |
09 Feb 2004 12:32:36 AM |
|
|
"Hilary Zhang" <hzhang@sfu.ca> wrote in message
news:c078ni$mu4$1@morgoth.sfu.ca...
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:
{
// 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, 128);
// 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.
The first problem is that you're asking about this in the wrong place.
We only discuss ISO standard C++ here, as indicated in:
http://www.slack.net/~shiva/welcome.txt
The place to ask about Windows programming issues is newsgroup
comp.os.ms-windows.programmer.win32
If it turns out the problem is with the OpenGL stuff, try:
comp.graphics.api.opengl
-Mike
.
|
|
|
| User: "Hilary Zhang" |
|
| Title: Re: [OT, welcome msg, redirect] Unhandled exception when ending a program |
09 Feb 2004 12:40:39 AM |
|
|
Sorry for asking the wrong place.
Thanks for the suggestion.
Hilary
"Mike Wahler" <mkwahler@mkwahler.net> wrote in message
news:8QFVb.20557$uM2.13305@newsread1.news.pas.earthlink.net...
"Hilary Zhang" <hzhang@sfu.ca> wrote in message
news:c078ni$mu4$1@morgoth.sfu.ca...
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:
{
// 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, 128);
// 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.
The first problem is that you're asking about this in the wrong place.
We only discuss ISO standard C++ here, as indicated in:
http://www.slack.net/~shiva/welcome.txt
The place to ask about Windows programming issues is newsgroup
comp.os.ms-windows.programmer.win32
If it turns out the problem is with the OpenGL stuff, try:
comp.graphics.api.opengl
-Mike
.
|
|
|
|
|

|
Related Articles |
|
|