//hFile = CreateFile("D:devfmt
esface1.png", 0, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
//hFile = CreateFileW(L"D:devfmt
esface1.png", 0, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
//hFile = CreateFile("D:devfmt
esface1.png", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
//hFile = CreateFileW(L"D:devfmt
esface1.png", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
-------------以上错误
-------------下面正确
hFile = CreateFile("D:\dev\fmt\res\face1.png", 0, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
hFile = CreateFile(_T("D:\dev\fmt\res\face1.png"), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
hFile = CreateFileW(L"D:\dev\fmt\res\face1.png", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
hFile = CreateFile(".\test.iobj", 0, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
前面注释的都是错误的,对路径的写法有要求,一定要是\