|
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_
|
|
|
|
|
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 ?
|
|
|
|
|
Yes. It contains a meaningful value. It contains the following:
osg::ref_ptr<dtCore::Object> {_ptr=0x018285f8 } osg::ref_ptr<dtCore::Object>
|
|
|
|
|
T.RATHA KRISHNAN wrote: GetOSGNode()
What happens inside the GetOSGNode() method?. Post us the code piece...
Regards,
Rane
|
|
|
|
|
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
|
|
|
|
|
Hi all,
If Anybody creates setup package using InnoSetup,how to install a driver (eg.B100.inf).Pls help me.....
Thanks & Regards,
Anitha
|
|
|
|
|
Have you seen this[^]
Regards,
Rane
|
|
|
|
|
Is there any function to do the following operation in CPP?
Round(3.4) = 3
Round(3.5) = 4
|
|
|
|
|
ceil() function?
ceil( 3.4 + 0.5 ) = 3;<br />
ceil( 3.5 + 0.5 ) = 4;
|
|
|
|
|
see ceil(3.4) will return 4. please check.
|
|
|
|
|
did u try any of
double floor(double x);
float floor(float x);
long double floor(long double x);
float floorf(float x);
- Malli...!
|
|
|
|
|
..am sorry..
I was ment to say floor () function. Please you floor ().
|
|
|
|
|
Yes its working now. Thanks.
|
|
|
|
|
You have to use floor() and add 0.5 to the number you want to round.
|
|
|
|
|
|
Try:
floor(x + 0.5)
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
Fastest way, assembler automatically will do rounding for you, but std lib does it some bakwards way
inline int iround(double v)
{
int retval;
__asm fld qword ptr [v]
__asm fistp dword ptr [retval]
return retval;
}
|
|
|
|
|
my dll code:
void Init()
{
...
CreateThread(NULL, 0, Fun, this, 0, &dw);
...
}
DWORD WINAPI Fun(LPVOID lParam)
{
int i = 0;
while(1)
{
CString cstr;
cstr = "abc";
while(i++>10)
{
CString cstr2;
cstr2 = "eee";
}
}
}
but if I change while(i++>10) to while(i++>2)
CString cstr2 = "eee"; was all right.
|
|
|
|
|
What was the exact error message?
Why don't you use the debugger?
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
[My articles]
|
|
|
|
|
Hi,
I have a tree such that it can be uniquely determined from its preorder.I have information on which are internal nodes and which are leaves.Something like this
----0
----/-\
---0--0
--/-\--/-\
-1--0-1--1
----/-\
----1--1
the preorder being 001011011
I need some logic to get the tree structure from this preorder
|
|
|
|
|
Following is not the full fleshed code, it's just a skeletal that gives you an idea for implementation (as u just asked for logic ). Better you implement the rest of the part.
class node
{
node *m_pLeftNode;
node *m_pRightNode;
int m_iData;
public :
PostOrderTravarse()
{
m_pLeftNode->PostOrderTravarse();
m_pRightNode->PostOrderTravarse();
cout<<m_iData;
}
PreOrderTravarse()
{
cout<<m_iData;
m_pLeftNode->PreOrderTravarse();
m_pRightNode->PreOrderTravarse();
}
InOrderTravarse()
{
m_pLeftNode->InOrderTravarse();
cout<<m_iData;
m_pRightNode->InOrderTravarse();
}
};
All the best !
- Malli...!
|
|
|
|
|
ummmm...those are tree traversals
I need to construct my tree FROM a preorder traversal
|
|
|
|
|
You may get the same sequence from different binary trees. So its not possible.
|
|
|
|