Access Violation Reading location
-
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?
-
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?
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_
-
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?
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++ -
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_
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?
-
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++Yes. It contains a meaningful value. It contains the following: osg::ref_ptrdtCore::Object {_ptr=0x018285f8 } osg::ref_ptrdtCore::Object
-
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?
-
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?
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
, andm_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