Google the error message gives me http://www.thescripts.com/forum/thread493003.html
In VC++ 8, iterators into vectors become invalidated whenever the number of elements in the vector changes. The invalidation happens immediately. The size of the loop is irrelevant. You can use #define _HAS_ITERATOR_DEBUGGING 0 to prevent the invalidation, but I don't recommend it unless you're really sure about what you're doing.