chiara3.0
23-04-2009, 11:23
In una soluzione SmartDevice in C++ ho 3 progetti
Project A:
TestProjectA::TestProjectA(){}
void TestProjectA::testThrowException()
{
int cont = 0;
if(cont == 0)
throw exception();
}
Project B:
TestRethrowException::TestRethrowException()
{
this->projA = new TestProjectA();
}
void TestRethrowException::testRethrowException()
{
try
{
projA->testThrowException();
}
catch(exception)
{
throw exception();
}
}
Main
TestRethrowException *tr = new TestRethrowException();
int i=0;
for(i=0;i<3;i++)
{
try
{
tr->testRethrowException();
}
catch(exception)
{
int y = 0;
int u = 0;
}
}
Quando i=0 l'eccezione è catturata
Quando i=1 l'eccezione è catturata
quando i=2 entra nel metodo "FindFrameInfo(EHRegistrationNode *pRN)"
che è nel file "frame_ce.cpp" di Microsoft.
In questo metodo entra in un ciclo infinito. perché?
Project A:
TestProjectA::TestProjectA(){}
void TestProjectA::testThrowException()
{
int cont = 0;
if(cont == 0)
throw exception();
}
Project B:
TestRethrowException::TestRethrowException()
{
this->projA = new TestProjectA();
}
void TestRethrowException::testRethrowException()
{
try
{
projA->testThrowException();
}
catch(exception)
{
throw exception();
}
}
Main
TestRethrowException *tr = new TestRethrowException();
int i=0;
for(i=0;i<3;i++)
{
try
{
tr->testRethrowException();
}
catch(exception)
{
int y = 0;
int u = 0;
}
}
Quando i=0 l'eccezione è catturata
Quando i=1 l'eccezione è catturata
quando i=2 entra nel metodo "FindFrameInfo(EHRegistrationNode *pRN)"
che è nel file "frame_ce.cpp" di Microsoft.
In questo metodo entra in un ciclo infinito. perché?