如何使用C ++在Windows上使用UNICODE路径创建文件 [英] How to create a file with UNICODE path on Windows with C++

查看:67
本文介绍了如何使用C ++在Windows上使用UNICODE路径创建文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道哪个Win32 API调用正在创建具有UNICODE路径的文件.只是为了确保,我在这里只讨论文件路径而不是内容.如果有人用MSDN网址打我,我将不胜感激,这次我的Google Fu失败了.

I am wondering which Win32 API call is creating the files with UNICODE path. Just to make sure, I am not talking about the content here only the file path. I would appreciate if somebody would hit me with an MSDN url, my google fu failed this time.

预先感谢一百万.

推荐答案

请参见 CreateFile msdn链接:

See CreateFile msdn link: http://msdn.microsoft.com/en-us/library/windows/desktop/aa363858%28v=vs.85%29.aspx, if you pass a unicode string to the lpFileName parameter then the unicode version of CreateFile will be used.

此外,您需要以二进制模式打开文件,请参阅msdn论坛上的以下讨论: http://msdn.microsoft.com/en-us/library/c4cy2b8e%28vs.71%29.aspx

Also you need to open the file in binary mode see this discussion on msdn forum: http://social.msdn.microsoft.com/forums/en-US/vclanguage/thread/71fa98ca-e757-4099-8f7f-fefcfe645298 which points to this msdn article: http://msdn.microsoft.com/en-us/library/c4cy2b8e%28vs.71%29.aspx

这篇关于如何使用C ++在Windows上使用UNICODE路径创建文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆