The string you retrieved is correct, however if you use it with a function that expects non-unicode strings like error() they don't work correctly. In this case the first character ('C') of your string is not one byte large as the engine expects because it's unicode (still, it happens to have the same ascii value in the first byte). When the engine continues to read the string it expects the second byte to be the next character. However, this byte is still part of the first unicode character and since it has the value 0x00 in this case, the engine interperts it as the end of string character and cuts off the rest.

Like txesmi said, TEXT and PANEL can display the string correctly. draw_text() works aswell (I believe it works the same as TEXT/PANEL drawing)

Regarding the CreateDirectory() function: when using the windows API you have to be pretty careful with unicode/non-unicode strings. If SHGetFolderPath returns a wstring (which it seems it does) you'd have to use CreateDirectoryW.


POTATO-MAN saves the day! - Random