zoukankan      html  css  js  c++  java
  • vc++ CreateFile报错,返回123

    //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);
    前面注释的都是错误的,对路径的写法有要求,一定要是\

  • 相关阅读:
    hadoop中map和reduce的数量设置问题
    Flink基础
    Leetcode中的SQL题目练习(二)
    Redis-2- 基本概念
    Redis-1-安装
    C#事件(1)
    java(13)内部类
    java(12)异常处理
    java(11)构造器
    java(10)接口抽象类
  • 原文地址:https://www.cnblogs.com/baldermurphy/p/6163784.html
Copyright © 2011-2022 走看看