Post this question into appropriate forum, like Managed C++/CLI or some .Net one.
The Visual C++ Programming has nothing to do with the code you posted.