Need help

Started by
4 comments, last by glPerfect 22 years, 4 months ago
Hi everybody. I have an big problem with the Vertex-storage. I''m not able to load much vertex-arrys. I put the source on http://www.bozkurtwebspace.com.kg/noname/ can somebody help me? mail at: Markus_Reitmeier@Hotmail.com thx
Advertisement
Your code is running fine here, except that using globals to store class data is bad : all your MESH objects seem to share the same OBJECT*. And GetObjectIndex() may not return a value.

What problems do you run into, exactly ?
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
I get an error message:
Unhandled exception in Raven.exe 0xC0000005: Access Violation.

at the debug window:
First-chance exception in Raven.exe: 0xC0000005: Access Violation.

the error is at the AddVertex routine, but only when the 4. Vertex is adding to the other.

sObject[nCurObject].vVertex[nCurVertex].z = z;

That''s a memory allocation issue.
That means either

sObject[nCurObject]

or

vVertex[nCurVertex]

does not exist and you''re trying to put something where something doesn''t exists. So you get that error.

Double check your array initialization and make sure that nCurObject and nCurVertex are not greater than the size of the array...

- Mike
"The important thing to remember when programming is: When you're 90% complete, there's still 50% more to go."
The sObject and vVertex is correctly initialized.

the nCurObject value is 0
the nCurVertex value is 3

that all is correct.

The first 3 runs are ok. After the 3rd one the following error appears.

CXX0030: Error: expression cannot be evaluated
Still works without a hitch here (VC++ Pro 6.0, Service Pack 5, Processor Pack) both in debug and release.

The step by step in AddVertex passes through nCurObject == 0, nCurVertex == 3 without problem.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan

This topic is closed to new replies.

Advertisement