473,385 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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.
Jul 22 '05 #1
3 2312

"Hilary Zhang" <hz****@sfu.ca> wrote in message
news:c0**********@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
Jul 22 '05 #2

"Hilary Zhang" <hz****@sfu.ca> wrote in message
news:c0**********@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
Jul 22 '05 #3
Sorry for asking the wrong place.
Thanks for the suggestion.

Hilary

"Mike Wahler" <mk******@mkwahler.net> wrote in message
news:8Q*******************@newsread1.news.pas.eart hlink.net...

"Hilary Zhang" <hz****@sfu.ca> wrote in message
news:c0**********@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

Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Oliver | last post by:
Hello, I may have posted in the wrong place, if so, feel free to move my post (just notify me where you put it via email or something) I’m having a problem with my program that I cant...
0
by: Marco Viana | last post by:
Hi, I'm developing an ASP.NET application with Visual Studio .NET 2003 in a Win XP Professional, .NET Framework 1.1 and IIS 5.1 computer with all the lattest patches. When testing a page...
5
by: Dave Stewart | last post by:
I recently wrote my first Vb.net application, or at least my first complex app since moving up from vb6. When run from the VS.NET IDE, the program shows no errors and runs fine. When the output exe...
5
by: Lucvdv | last post by:
Can someone explain why this code pops up a messagebox saying the ThreadAbortException wasn't handled? The first exception is reported only in the debug pane, as expected. The second (caused by...
5
by: Simon Tamman {Uchiha Jax} | last post by:
Now this is bugging me. I just released software for a client and they have reported an unhandled stack overflow exception. My first concern is that the entirity of the UI and any threaded...
4
by: bg_ie | last post by:
Hi, I have the following Program.cs - namespace TestFrameworkApplication { static class Program { /// <summary> /// The main entry point for the application.
5
by: =?Utf-8?B?c3VydHVyeg==?= | last post by:
Hi, I feel like a noob for asking this. When I publish a VB windows application, I want to disable the ability of the the user to continue when there is an unhandled exception. For example,...
1
by: aine_canby | last post by:
Hi, This is my Program class in my Application - static class Program { /// <summary> /// The main entry point for the application. /// </summary>
7
by: j4richard | last post by:
Help please, I am getting this "Unhandled Exception has occurred in your application" " A Generic error occurred in GDI+" See the end of this message for details on...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.