Don't do that in the future. What you basically did is write some code that didn't work, then change 90% of it, so you potentially covered up your errors, and created other, new errors, then failed to explain this to anybody so we had no idea what we were dealing with. Next time, if you're writing in C++, leave it in C++ and go to the C++ forum. They're two very different languages, and the experts there (there are many) are as good in C++ as the C experts here. Still, glad you got it figured out.