I got the posted code to pass with VC7.1, /MDd and /Zc:wchar_t.