Original Post
I keep getting an exception in this line:
if (!HeapValidate(_crtheap, 0, NULL))
of the int __cdecl _heapchk (void) function.
I''m using .net Professional. This is the code is causing the problems...
The error happens on the 27th iteration of the bottom loop, when new is called on the Vertices pointer. NumFrames is somewhere in the vicinity of 200, and ArraySize is around 10,000. The Vertices var is defined as float ** Vertices;
I really can''t find what''s causing this error. Just hoping that a few more sets of eyes might help me out. I have service pack 2 for .net installed.
Thanks
Marcus
FILE * f = fopen(FName,"rb");
if(f == NULL)
return;
fread(&NumFrames, 1, sizeof(int), f);
fread(&ArraySize, 1, sizeof(int), f);
fread(&UVArraySize,1,sizeof(int), f);
TVertices = new float[NumFrames];
Vertices = new float*[NumFrames];
Colors = new char*[NumFrames];
WeapFront = new Vertex[NumFrames];
WeapBack = new Vertex[NumFrames];
fread(TVertices,sizeof(float),UVArraySize,f);
for(int i=0;i<NumFrames;i++)
{
fread(&WeapFront[i],sizeof(Vertex),1,f);
fread(&WeapBack[i],sizeof(Vertex),1,f);
Vertices[i] = new float[ArraySize];
Colors[i] = new char[ArraySize];
fread(Vertices[i],ArraySize,sizeof(float),f);
fread(Colors[i],ArraySize,sizeof(char),f);
}
fclose(f);