You're suffering from a common problem. You want to build the Eiffel Tower, and you're yet to build a sandcastle. Instead of copying and pasting code almost at random, you should buy a beginner book on C++, and work through it. Then, when you can interpret the code you're copying, you may have a shot at making it work. Yes, if we posted back and forth four more times, we might get past this problem, but it would not help you in the long run. You're biting off more than you can chew. Buy a book ( teach yourself C++ in 24 hours is a good one ), and ask questions here when you get stuck, but work through it. Then try a few simpler projects, before you start trying to manipulate COM objects and otherwise use more complex APIs. Christian Graus - Microsoft MVP - C++