December 10th, 2008, 04:41 PM
Problem with Japanese system
I am facing trouble in a Japanese systems.
I am trying to create a shortcut/file on to user desktop. Its failing with out any clue.
I am creating a short cut in "C:\\Documents and Settings\\username\\デスクトップ\\link.lnk"
Where デスクトップ is the string "Desktop" equivalent in Japanese. I am storing the path using wchar_t data type. The problem I feel is that we are not able to access the デスクトップ folder. I am getting an error telling that the file name, directory name, or volume label syntax is incorrect. All the Windows API call using this path is failing. I am able to create files and shortcuts in C:\\Documents and Settings\\username" but not inside C:\\Documents and Settings\\username\\デスクトップ" folder. The API is working fine it has got something to do with the data representation.
Normal file creation is also failing. The code extract is
mbstowcs( name, "C:\\Documents and Settings\\username\\デスクトップ\\link.lnk", MAX_PATH);
CreateFileW( name, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
What am I missing out. Thanks for your help and suggestions..
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!