On 10/06/2014 at 02:40, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 13-15
Platform: Windows ;
Language(s) : C++ ;
---------
Hi,
I'm really despairing... Win7 x64: Debug version works, Release version breaks with an access violation exception. (Btw: no problems on MacOS) The exception occurs everytime at the same position. It's a simply function that takes a pointer of a point array including point count and an index to calculte a matrix at this point:
Matrix Get_PointMatrix(Vector *pAdr, LONG pcnt, LONG index, Vector up)
{
Vector p1, p2;
Matrix m = Matrix();
//if (index < 0 || index > pcnt || pcnt > 500 || !pAdr)
// return m;
BREAK-> m.off = pAdr[index];
if (index < pcnt - 1)
p2 = pAdr[index+1];
else
p2 = pAdr[0];
if (index > 0)
p1 = pAdr[index-1];
else
p1 = pAdr[pcnt-1];
m.v3 = !(p2 - p1);
m.v2 = up;
m.v1 = -(m.v3 % m.v2);
return m;
}
pAdr is 0 at the break point. When I go up the call stack, the values are OK. But I don't know, if I can rely on the displayed values, since I have to run the release version in debug mode.
Any help is very appreciated!
Thanks
Klaus