Archived

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

New problem...

This topic is 6063 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

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
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
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.

Share on other sites
Another possibility is that you do not have write-access to the current directory. This could either be because you''re simply not allowed to write files there, that the disk is full, or that a write-protected file of the same name is in the directory.

-Neophyte

- Death awaits you all with nasty, big, pointy teeth. -

• 37
• 12
• 10
• 10
• 9
• Forum Statistics

• Total Topics
631360
• Total Posts
2999554
×

Important Information

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!