Thank you all!
But I do not want to start from scratch. Any hint?
There's no reason to do that, Nancy....
Something I do a lot when working on difficult code is to write a small "side program" to test certain things so I can understand how they work without messing up my main project. For example ... I recently did some coding with a tree view control, but was having a bit of trouble getting stored data pointers back from it's LPARAM storage... so I wrote a small side program that I could afford to messup as royally as I needed to and stayed with it until I got it working... then I simply took the working solution and transplanted it into my main project.
Programmers do stuff like that all the time. Some of my very best code is stored away in projects named test1, test2, mumble and glorp...