Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Exception

Exception

Scheduled Pinned Locked Moved C / C++ / MFC
comquestion
8 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anandi VC
    wrote on last edited by
    #1

    First-chance exception in DWB.exe (OLEAUT32.DLL): 0xC0000005: Access Violation. Could any one tell me the meaning of the above sentence ? i got this exception while working on VC6 and COM components. thanks in advance, Anandi VC

    C CPalliniC R 3 Replies Last reply
    0
    • A Anandi VC

      First-chance exception in DWB.exe (OLEAUT32.DLL): 0xC0000005: Access Violation. Could any one tell me the meaning of the above sentence ? i got this exception while working on VC6 and COM components. thanks in advance, Anandi VC

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      Anandi.VC wrote:

      Could any one tell me the meaning of the above sentence ?

      You did something wrong within your program. That's about all we can say about it. But I know somebody who can help you much more than us, he is called Mr. Debugger :) Joke aside, if you want to have more information about the problem, use your debugger: step into your program around the code which causes the problem, check the call stack, verify the different variables...

      Cédric Moonen Software developer
      Charting control [v1.4]

      P 1 Reply Last reply
      0
      • A Anandi VC

        First-chance exception in DWB.exe (OLEAUT32.DLL): 0xC0000005: Access Violation. Could any one tell me the meaning of the above sentence ? i got this exception while working on VC6 and COM components. thanks in advance, Anandi VC

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #3

        Invalid memory access. (buggy pointer?) :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

        In testa che avete, signor di Ceprano?

        1 Reply Last reply
        0
        • C Cedric Moonen

          Anandi.VC wrote:

          Could any one tell me the meaning of the above sentence ?

          You did something wrong within your program. That's about all we can say about it. But I know somebody who can help you much more than us, he is called Mr. Debugger :) Joke aside, if you want to have more information about the problem, use your debugger: step into your program around the code which causes the problem, check the call stack, verify the different variables...

          Cédric Moonen Software developer
          Charting control [v1.4]

          P Offline
          P Offline
          Programm3r
          wrote on last edited by
          #4

          Cedric Moonen wrote:

          he is called Mr. Debugger

          lol .... :jig:


          The only programmers that are better that C programmers are those who code in 1's and 0's :bob: :)Programm3r My Blog: ^_^

          1 Reply Last reply
          0
          • A Anandi VC

            First-chance exception in DWB.exe (OLEAUT32.DLL): 0xC0000005: Access Violation. Could any one tell me the meaning of the above sentence ? i got this exception while working on VC6 and COM components. thanks in advance, Anandi VC

            R Offline
            R Offline
            Rajkumar R
            wrote on last edited by
            #5

            Anandi.VC wrote:

            First-chance exception in DWB.exe (OLEAUT32.DLL): 0xC0000005: Access Violation. Could any one tell me the meaning of the above sentence ?

            can be invalid pointer access. and what is First-Chance exception? When Exception Occurs debugger get notified and this first pass is called "First-Chance Exception", the debugger can then decide to pass to application to run normally if the exception was not handled by the application then the debugger gets notified again and is "second-chance exception" where the application must crash. [First and second chance exception handling^] Several cases the first chance exceptions don’t necessarily need to be dangerous and does not mean application's code is not proper. for instance the following code causes first chance exception message to be written in output window

            try
            {
            throw 100;
            }
            catch (...)
            {
            cout << "exception";
            }

            try // SEH is enabled
            {
            int *ptr = (int *)0x01;
            *ptr = 1000;
            }
            catch (...)
            {
            cout << "exception";
            }

            but the application handled the exception, so you don't get second chance exception. This may not be a buggy code, but if it is buggy you cannot find the exact position of exception as the default settings of the debugger won't break execution at first-chance exception, you can enable the debugger to break at First -chance Exception so that you can get the exact position. say in VS2005, "Debug->Exceptions: then check mark exception in the list". I don't remember in VS6.0 (its time to throw these old stuff dude ;) )

            modified on Thursday, May 8, 2008 11:05 AM

            S A 2 Replies Last reply
            0
            • R Rajkumar R

              Anandi.VC wrote:

              First-chance exception in DWB.exe (OLEAUT32.DLL): 0xC0000005: Access Violation. Could any one tell me the meaning of the above sentence ?

              can be invalid pointer access. and what is First-Chance exception? When Exception Occurs debugger get notified and this first pass is called "First-Chance Exception", the debugger can then decide to pass to application to run normally if the exception was not handled by the application then the debugger gets notified again and is "second-chance exception" where the application must crash. [First and second chance exception handling^] Several cases the first chance exceptions don’t necessarily need to be dangerous and does not mean application's code is not proper. for instance the following code causes first chance exception message to be written in output window

              try
              {
              throw 100;
              }
              catch (...)
              {
              cout << "exception";
              }

              try // SEH is enabled
              {
              int *ptr = (int *)0x01;
              *ptr = 1000;
              }
              catch (...)
              {
              cout << "exception";
              }

              but the application handled the exception, so you don't get second chance exception. This may not be a buggy code, but if it is buggy you cannot find the exact position of exception as the default settings of the debugger won't break execution at first-chance exception, you can enable the debugger to break at First -chance Exception so that you can get the exact position. say in VS2005, "Debug->Exceptions: then check mark exception in the list". I don't remember in VS6.0 (its time to throw these old stuff dude ;) )

              modified on Thursday, May 8, 2008 11:05 AM

              S Offline
              S Offline
              Stephen Hewitt
              wrote on last edited by
              #6

              Rajkumar R wrote:

              try // SEH is enabled { int *ptr = (int *)0x01; *ptr = 1000; } catch (...) { cout << "exception"; }

              This construct is non-standard. The C++ standard states that catch can only catch exceptions explicitly thrown via the throw keyword. Microsoft got it wrong but later added the /EH[^] switch to select the old non-standard behaviour or the behaviour mandated by the C++ standard.

              Steve

              R 1 Reply Last reply
              0
              • S Stephen Hewitt

                Rajkumar R wrote:

                try // SEH is enabled { int *ptr = (int *)0x01; *ptr = 1000; } catch (...) { cout << "exception"; }

                This construct is non-standard. The C++ standard states that catch can only catch exceptions explicitly thrown via the throw keyword. Microsoft got it wrong but later added the /EH[^] switch to select the old non-standard behaviour or the behaviour mandated by the C++ standard.

                Steve

                R Offline
                R Offline
                Rajkumar R
                wrote on last edited by
                #7

                Yes steve, you are correct that's "Microsoft specific" . 5! for the description for what i mentioned by the comment // SEH is enabled.

                1 Reply Last reply
                0
                • R Rajkumar R

                  Anandi.VC wrote:

                  First-chance exception in DWB.exe (OLEAUT32.DLL): 0xC0000005: Access Violation. Could any one tell me the meaning of the above sentence ?

                  can be invalid pointer access. and what is First-Chance exception? When Exception Occurs debugger get notified and this first pass is called "First-Chance Exception", the debugger can then decide to pass to application to run normally if the exception was not handled by the application then the debugger gets notified again and is "second-chance exception" where the application must crash. [First and second chance exception handling^] Several cases the first chance exceptions don’t necessarily need to be dangerous and does not mean application's code is not proper. for instance the following code causes first chance exception message to be written in output window

                  try
                  {
                  throw 100;
                  }
                  catch (...)
                  {
                  cout << "exception";
                  }

                  try // SEH is enabled
                  {
                  int *ptr = (int *)0x01;
                  *ptr = 1000;
                  }
                  catch (...)
                  {
                  cout << "exception";
                  }

                  but the application handled the exception, so you don't get second chance exception. This may not be a buggy code, but if it is buggy you cannot find the exact position of exception as the default settings of the debugger won't break execution at first-chance exception, you can enable the debugger to break at First -chance Exception so that you can get the exact position. say in VS2005, "Debug->Exceptions: then check mark exception in the list". I don't remember in VS6.0 (its time to throw these old stuff dude ;) )

                  modified on Thursday, May 8, 2008 11:05 AM

                  A Offline
                  A Offline
                  Anandi VC
                  wrote on last edited by
                  #8

                  Thank u very much for your clear explanation. i would love to switch to the latest version of VC but my work place wont permit it ! :)

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups