Results 1 to 4 of 4

Thread: Unhandled exception

  1. #1
    Join Date
    Mar 2008
    Posts
    177

    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

  2. #2
    Join Date
    Oct 2008
    Posts
    55

    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.

  3. #3
    Join Date
    Mar 2008
    Posts
    429

    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

  4. #4
    Join Date
    May 2008
    Posts
    143

    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);

Similar Threads

  1. Getting Unhandled Exception Error Number: ib acer
    By Chillam in forum Portable Devices
    Replies: 3
    Last Post: 22-02-2011, 08:11 AM
  2. NAT IP .Net Framework Unhandled exception error
    By ashenoy in forum Software Development
    Replies: 9
    Last Post: 24-08-2010, 04:04 PM
  3. AxAcroPDF throws unhandled exception on click of TAB
    By Who is it in forum Windows Software
    Replies: 5
    Last Post: 14-07-2010, 03:38 AM
  4. Internet Explorer Unhandled Exception Error
    By savio in forum Technology & Internet
    Replies: 3
    Last Post: 23-12-2009, 06:46 PM
  5. an unhandled win32 exception occurred in explorer.exe
    By meditative in forum MediaCenter
    Replies: 2
    Last Post: 06-10-2008, 07:33 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,047,269.95553 seconds with 16 queries