Click to See Complete Forum and Search --> : Open with very large files


jondotdot
April 19th, 2003, 06:45 PM
Hi

I get the following message as I start to read data from a very large 25M ascii chars file.

First-chance exception in MyApp.exe: 0xC00000FD: Stack Overflow.

It seems to work on much smaller files.

code fragment is
if( In->Open( dialg->GetPathName(), CFile::modeRead ) )
{
// Temporary buffer.
// Get the input file size so we know when we're done reading.
nFilesize = In->GetLength();
// read a block of data 4000 chars
int nsize=ReadData();
// crashes on entry to this next routine
GetData(nsize);
}

any suggestions

thanks

mwilliamson
April 19th, 2003, 09:24 PM
Is there a reason you need a recursive approach? It seems to be a loop will do just fine.

Ajay Vijay
April 20th, 2003, 04:29 AM
Just call out CFile::Read method passing it a pointer to hold data large enough you need!