#### Archived

This topic is now archived and is closed to further replies.

# New problem...

## Recommended Posts

ATronic    122
Hey all, I am having a little problem with file access. I get an access violation in the following lines:
  FILE *modelFile; modelFile = fopen(filename, "wb"); //Access Violation Is Here 
I ran it in debug mode and traced the problem to the memory allocation of the file buffer. It occures in the "construct block" function as far as I can tell. Anyone had this problem before or know how to solve it? I''m stumped. Alex Broadwin A-Tronic Software & Design ----- "if you fail in life, you were destined to fail. If you suceed in life, call me." "The answer is out there." "Please help, I''m using Windows!"

##### Share on other sites
ATronic    122
Pleeeassse.....Help me. This is gonna freeze my development until it is solved. The problem is in a sub-function of malloc. Anyone? Please? I know that nobody likes fighting with memory problems, but this must have come up before. Is this common with fopen?

A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."

##### Share on other sites
Kylotan    9982
No, it''s not at all common. fopen shouldn''t be crashing on you. I can only imagine that somehow you are corrupting memory elsewhere, because a million and one applications use fopen without any problems. Try calling the memory checking functions (assuming you''re using MSVC) in your main loop to see if your memory is getting corrupted at some point, and then find the problem by narrowing it down to the relevant line of code.