Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1100645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:54:47+00:00 2026-05-17T00:54:47+00:00

I got this exception in my program: Unhandled exception at 0x0051cce0 in JSONDataParsing.exe: 0xC0000005:

  • 0

I got this exception in my program:

Unhandled exception at 0x0051cce0 in
JSONDataParsing.exe: 0xC0000005:
Access violation reading location
0x00000004

.

I tried catching the Exception, but of no use. I know where the problem occurs. But wanted to know how I can trap the exception. I used try, catch block around the code where exception occurs.

Is this an exception which can not be caught?

The catch statements are:

catch (bad_alloc&)
        {
            TCHAR msgbuf[MAX_PATH];

            swprintf(msgbuf, L"bad_alloc \n");

            OutputDebugString(msgbuf);
        }
        catch (bad_cast&)
        {
            TCHAR msgbuf[MAX_PATH];

            swprintf(msgbuf, L"bad_cast \n");

            OutputDebugString(msgbuf);
        }
        catch (bad_exception&)
        {
            TCHAR msgbuf[MAX_PATH];

            swprintf(msgbuf, L"babad_exceptiond_alloc \n");

            OutputDebugString(msgbuf);
        }
        catch (bad_typeid&)
        {
            TCHAR msgbuf[MAX_PATH];

            swprintf(msgbuf, L"bad_alloc \n");

            OutputDebugString(msgbuf);
        }
        catch( CMemoryException* e )
        {

            TCHAR msgbuf[MAX_PATH];

            swprintf(msgbuf, L"CMemoryException \n");

            OutputDebugString(msgbuf);
            // Handle the out-of-memory exception here.
        }


        catch( CFileException* e )
        {

            TCHAR msgbuf[MAX_PATH];

            swprintf(msgbuf, L"CFileException \n");

            OutputDebugString(msgbuf);
            // Handle the file exceptions here.
        }

        catch( CException* e )
        {

            TCHAR msgbuf[MAX_PATH];

            swprintf(msgbuf, L"CException \n");

            OutputDebugString(msgbuf);
            // Handle the exception here.
            // "e" contains information about the exception.
            e->Delete();
        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T00:54:48+00:00Added an answer on May 17, 2026 at 12:54 am

    You can only catch such exception with a special try-catch handler:

    try
    {
      // code that triggers such an exception. for example:
      int * a = NULL;
      *a = 0;
    }
    catch (...)
    {
      // now that exception is handled here
    }
    

    But generally, it is bad practice to do this. Instead you should not get such an exception but check your parameters and variables.

    See here for more details:
    http://members.cox.net/doug_web/eh.htm

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got this error Unhandled exception at 0x0049b946 in Program.exe: 0xC0000005: Access violation reading
I got this exception ... EntityCategoryProxy could not be converted to int in ...
I got this error message and I'm not quite sure whats wrong: Exception in
i got a webservicedefinition like this: [OperationContract] [FaultContract(typeof(Exception))] [WebInvoke(ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Wrapped,
I am getting a weird exception when I exit the program. This has started
I am still new in objective-c programming, I got this exception, but I don't
I got this exception when i run the checking procedure for installation found there:
I am getting this exception sometimes when my program is starting connection to MS
I've got this code snnipet (the whole program compiles and links correctly): ... try
Ok, I got this multi-threaded C++ program that I try to debug in Visual

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.