我想用CreateDirectory函数创建一个目录。但它似乎并没有像我期望的那样工作。我的功能有什么问题?CreateDirectory函数不起作用
#include "stdafx.h"
#include<windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
wchar_t *path = L"C:\\Users\TempFolder";
CreateDirectory (path , NULL);
return 0;
}
您没有检查错误。这是Win32 101.请重复我后,我保证在调用Win32 API函数时检查错误,我保证在调用Win32 API函数时检查错误,我保证在调用Win32 API函数时检查错误。 ... –
[为什么字符串中的反斜杠必须在C++中转义?](http://stackoverflow.com/questions/13986708/why-must-backslashes-in-string-literals-be-escaped-in -c) – IInspectable
我保证在调用Win32 API函数时检查错误,我保证在调用Win32 API函数时检查错误,我保证在调用Win32 API函数时检查错误;):D非常感谢 – Jimmy