VC++ 2012: Fixed compile errors, added solution/project file

Tested with Visual Studio 2012/VC++ (XP target). Compiles with Qt 4.8.4/MingW (I had to fix the .pro file a little bit first), but haven't done any further testing with Qt.

Also moved Windows-specific code to implementation because macros caused problems after including the headers.