View Single Post
Join Date: Aug 2005
Posts: 15,149
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1435
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: Iterator assertion failure. How?

 
0
  #2
May 14th, 2008
My guess is that neither of those loops will work.
1) how is iter_vsDirectory initialized? You failed to post it.

2) what is the purpose of that first loop with the iterator ? The iterator doesn't appear to be used anywhere within the loop. Adding more strings to the end of the vector might invalidate the iterator.

3) You have to call FindFirstFile() before you can start a loop for FindNextFile(). The FindNextFile() you have code will always fail.

  1. HANDLE hFile = FindFirstFile( // blabla );
  2. if( hFile != INVALID_HANDLE_VALUE)
  3. {
  4. while( FindNextFile( // blabla ) )
  5. {
  6.  
  7. }
  8. }
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote