I am in the process of taking some 3rd party c++ source code, and converting it to VS2005. One thing I noticed over and over, is that when you are reading in file contents, you need to make sure to release the buffer, but with the length of the file as the parameter.
For example, this code:
if (file.Open(lpszFilename, CFile::modeRead))
DWORD dwLength = file.GetLength();
will throw an assertion when in debug mode
to fix, add the dwLength value to your ReleaseBuffer()
if you run the bad code in release mode, nothing happens, which suprises me, you would think that the runtime would croak, but it doesn’t. Anyways, make sure to release your buffers.