<分区>
我必须用 C++ 编写 CreateFile 函数 我写了这个,但是没有用
#include <iostream>
#include <windows.h>
#include <string>
using namespace std;
int main()
{
HANDLE hfile = CreateFile(
".\temp.txt", // "\\.\C:"
GENERIC_READ,
0,
NULL,
CREATE_NEW,
FILE_ATTRIBUTE_NORMAL,
NULL);
//if (hFile == INVALID_HANDLE_VALUE) cout << "Unable to create file \n";
return 0;
}
error C2664: 'CreateFileW' : cannot convert parameter 1 from 'const char [10]' to 'LPCWSTR'
我该如何修复这个错误?