I am having trouble reading files. I can open the file O.K. but when I try to read the file, file.Read(myfile,5), it runs the program but then it comes up with a Visual C++ debug error. HELP!!
If Your buffer myfile is not shorter as 5 Bytes, this error can appears if You make
file.Close();
after You do not need the File more. It is a bug of CFile, I think, destructor of the CFile does not allways check if the File was closed and tries to close it itself. Try to remove Your file.Close() - function.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.