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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Access Violation Reading location

Access Violation Reading location

Scheduled Pinned Locked Moved C / C++ / MFC
sharepointdebuggingtutorialquestion
7 Posts 5 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.
  • T Offline
    T Offline
    T RATHA KRISHNAN
    wrote on last edited by
    #1

    When I run a project, it shows exception. If I debug using F11 or F10, I can't go beyond that line where it shows exception. I can't see Disassembly also. What to do? Here is the code:

    void TestAI::EnableShaders()
    {
    dtCore::ShaderManager& sm = dtCore::ShaderManager::GetInstance();
    dtCore::ShaderProgram* sp = sm.FindShaderPrototype("TestShader", "TestShader");
    if(sp != NULL)
    {
    sm.AssignShaderFromPrototype(*sp, *m_Obj->GetOSGNode());
    mEnabled = true;
    }
    }

    Exception occurs at the following line: sm.AssignShaderFromPrototype(*sp, *m_Obj->GetOSGNode()); Here is the contents of Output Window. First-chance exception at 0x00407336 in GUI.exe: 0xC0000005: Access violation reading location 0x00000020. Unhandled exception at 0x00407336 in GUI.exe: 0xC0000005: Access violation reading location 0x00000020. How to resolve these exception?

    _ C R D 4 Replies Last reply
    0
    • T T RATHA KRISHNAN

      When I run a project, it shows exception. If I debug using F11 or F10, I can't go beyond that line where it shows exception. I can't see Disassembly also. What to do? Here is the code:

      void TestAI::EnableShaders()
      {
      dtCore::ShaderManager& sm = dtCore::ShaderManager::GetInstance();
      dtCore::ShaderProgram* sp = sm.FindShaderPrototype("TestShader", "TestShader");
      if(sp != NULL)
      {
      sm.AssignShaderFromPrototype(*sp, *m_Obj->GetOSGNode());
      mEnabled = true;
      }
      }

      Exception occurs at the following line: sm.AssignShaderFromPrototype(*sp, *m_Obj->GetOSGNode()); Here is the contents of Output Window. First-chance exception at 0x00407336 in GUI.exe: 0xC0000005: Access violation reading location 0x00000020. Unhandled exception at 0x00407336 in GUI.exe: 0xC0000005: Access violation reading location 0x00000020. How to resolve these exception?

      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #2

      Do you check if your pointers are properly initialized. BTW what happens inside GetOSGNode function. Did you try to get into this while debugging?

      Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

      T 1 Reply Last reply
      0
      • T T RATHA KRISHNAN

        When I run a project, it shows exception. If I debug using F11 or F10, I can't go beyond that line where it shows exception. I can't see Disassembly also. What to do? Here is the code:

        void TestAI::EnableShaders()
        {
        dtCore::ShaderManager& sm = dtCore::ShaderManager::GetInstance();
        dtCore::ShaderProgram* sp = sm.FindShaderPrototype("TestShader", "TestShader");
        if(sp != NULL)
        {
        sm.AssignShaderFromPrototype(*sp, *m_Obj->GetOSGNode());
        mEnabled = true;
        }
        }

        Exception occurs at the following line: sm.AssignShaderFromPrototype(*sp, *m_Obj->GetOSGNode()); Here is the contents of Output Window. First-chance exception at 0x00407336 in GUI.exe: 0xC0000005: Access violation reading location 0x00000020. Unhandled exception at 0x00407336 in GUI.exe: 0xC0000005: Access violation reading location 0x00000020. How to resolve these exception?

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

        Did you use a debugger to see if everything is correct ? What is the value of m_Obj ?

        Cédric Moonen Software developer
        Charting control [v1.5] OpenGL game tutorial in C++

        T 1 Reply Last reply
        0
        • _ _AnsHUMAN_

          Do you check if your pointers are properly initialized. BTW what happens inside GetOSGNode function. Did you try to get into this while debugging?

          Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

          T Offline
          T Offline
          T RATHA KRISHNAN
          wrote on last edited by
          #4

          Yes. There's the problem. If I press F11 or F10, I can't go beyond that line(Exception Dialog is shown). What to do?

          1 Reply Last reply
          0
          • C Cedric Moonen

            Did you use a debugger to see if everything is correct ? What is the value of m_Obj ?

            Cédric Moonen Software developer
            Charting control [v1.5] OpenGL game tutorial in C++

            T Offline
            T Offline
            T RATHA KRISHNAN
            wrote on last edited by
            #5

            Yes. It contains a meaningful value. It contains the following: osg::ref_ptrdtCore::Object {_ptr=0x018285f8 } osg::ref_ptrdtCore::Object

            1 Reply Last reply
            0
            • T T RATHA KRISHNAN

              When I run a project, it shows exception. If I debug using F11 or F10, I can't go beyond that line where it shows exception. I can't see Disassembly also. What to do? Here is the code:

              void TestAI::EnableShaders()
              {
              dtCore::ShaderManager& sm = dtCore::ShaderManager::GetInstance();
              dtCore::ShaderProgram* sp = sm.FindShaderPrototype("TestShader", "TestShader");
              if(sp != NULL)
              {
              sm.AssignShaderFromPrototype(*sp, *m_Obj->GetOSGNode());
              mEnabled = true;
              }
              }

              Exception occurs at the following line: sm.AssignShaderFromPrototype(*sp, *m_Obj->GetOSGNode()); Here is the contents of Output Window. First-chance exception at 0x00407336 in GUI.exe: 0xC0000005: Access violation reading location 0x00000020. Unhandled exception at 0x00407336 in GUI.exe: 0xC0000005: Access violation reading location 0x00000020. How to resolve these exception?

              R Offline
              R Offline
              Rane
              wrote on last edited by
              #6

              T.RATHA KRISHNAN wrote:

              GetOSGNode()

              What happens inside the GetOSGNode() method?. Post us the code piece... Regards, Rane

              1 Reply Last reply
              0
              • T T RATHA KRISHNAN

                When I run a project, it shows exception. If I debug using F11 or F10, I can't go beyond that line where it shows exception. I can't see Disassembly also. What to do? Here is the code:

                void TestAI::EnableShaders()
                {
                dtCore::ShaderManager& sm = dtCore::ShaderManager::GetInstance();
                dtCore::ShaderProgram* sp = sm.FindShaderPrototype("TestShader", "TestShader");
                if(sp != NULL)
                {
                sm.AssignShaderFromPrototype(*sp, *m_Obj->GetOSGNode());
                mEnabled = true;
                }
                }

                Exception occurs at the following line: sm.AssignShaderFromPrototype(*sp, *m_Obj->GetOSGNode()); Here is the contents of Output Window. First-chance exception at 0x00407336 in GUI.exe: 0xC0000005: Access violation reading location 0x00000020. Unhandled exception at 0x00407336 in GUI.exe: 0xC0000005: Access violation reading location 0x00000020. How to resolve these exception?

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                T.RATHA KRISHNAN wrote:

                Exception occurs at the following line: sm.AssignShaderFromPrototype(*sp, *m_Obj->GetOSGNode());

                Setting a breakpoint on that line, what is the value of sm, sp, and m_Obj?

                "Love people and use things, not love things and use people." - Unknown

                "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

                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