T
Toon Huysmans
Hi,
I have a mind boggling error in VC++ .NET.
An exception THException is being thrown, but it seems to cause an
accessviolation, but the code is so simple that I cant figure out where the
av comes from.
MyMesh:oint cog()
{
if (fCount != 0)
return fCoG/fCount;
else
throw THException("There were no vertices to average...");
<--- this gets thrown
}
class THException
{
public:
THException(string msg){fMsg = msg;}
string getMessage(){return fMsg;}
protected:
private:
string fMsg;
};
try
{
...
mesh.cog()
...
}
catch(THException e)
{
cerr << "EXCEPTION:" << e.getMessage() << endl;
exit(1);
}
catch(...)
{
cerr << "EXCEPTION:" << "Unknown Exception caught..." << endl;
exit(1);
}
OUTPUT:
First-chance exception at 0x77e73887 in SphericalParameterization.exe:
Microsoft C++ exception: THException @ 0x0012f9d8.
First-chance exception at 0x004f1bbc in SphericalParameterization.exe:
0xC0000005: Access violation reading location 0xcdcdcddd.
I have a mind boggling error in VC++ .NET.
An exception THException is being thrown, but it seems to cause an
accessviolation, but the code is so simple that I cant figure out where the
av comes from.
MyMesh:oint cog()
{
if (fCount != 0)
return fCoG/fCount;
else
throw THException("There were no vertices to average...");
<--- this gets thrown
}
class THException
{
public:
THException(string msg){fMsg = msg;}
string getMessage(){return fMsg;}
protected:
private:
string fMsg;
};
try
{
...
mesh.cog()
...
}
catch(THException e)
{
cerr << "EXCEPTION:" << e.getMessage() << endl;
exit(1);
}
catch(...)
{
cerr << "EXCEPTION:" << "Unknown Exception caught..." << endl;
exit(1);
}
OUTPUT:
First-chance exception at 0x77e73887 in SphericalParameterization.exe:
Microsoft C++ exception: THException @ 0x0012f9d8.
First-chance exception at 0x004f1bbc in SphericalParameterization.exe:
0xC0000005: Access violation reading location 0xcdcdcddd.