CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2003
    Location
    New England
    Posts
    2

    Open with very large files

    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

  2. #2
    Join Date
    Dec 2001
    Location
    Ontario, Canada
    Posts
    2,236
    Is there a reason you need a recursive approach? It seems to be a loop will do just fine.

  3. #3
    Join Date
    Mar 2003
    Location
    India {Mumbai};
    Posts
    3,871
    Just call out CFile::Read method passing it a pointer to hold data large enough you need!
    My latest article: Explicating the new C++ standard (C++0x)

    Do rate the posts you find useful.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured