Fixed the code for Visual Studio 2010.