SDK中的Createfile的用法

tositp 2006-09-01 09:53:14
我的程序:
HANDLE hFile;
hFile = CreateFile("\\\\.\\D:", GENERIC_WRITE|GENERIC_READ, FILE_SHARE_WRITE, NULL
, CREATE_NEW, FILE_ATTRIBUTE_NORMAL
, NULL);
错误信息:
Compiling...
playwnd.cpp
D:\相关资料\IMPORTANT\PlayWnd\playwnd.cpp(494) : error C2664: 'CreateFileW' : cannot convert parameter 1 from 'char [7]' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
Creating browse info file...

PlayWnd.exe - 1 error(s), 0 warning(s)

请高手指点下!!第一个参数路径应该怎么写才对?
...全文
91 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
tositp 2006-09-01
  • 打赏
  • 举报
回复
我本来想写成"\\\\.\\D:\test.bmp"的,也不行

19,468

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧