You should probably be using TCHAR instead of char or wchar_t since that is defined by a windows header according to whether you are using Unicode or ANSI strings. You are probably actually compiling the code to use ANSI, but casting your Unicode strings to be copied over (of course, it won't be pretty since it should just copy over a single '\0'.

Why is this not on the Windows board is really what I am wondering.