1、头文件:shlwapi.h
2、链接库:Shlwapi.lib
#include <iostream>
#include <shlwapi.h>
using namespace std;
#pragma comment(lib,"Shlwapi.lib")
int main()
{
string str = "E:\\Visual Studio 2013\\Projects\\test\\abc";
if (PathFileExists(str.c_str()))
{
MessageBox(NULL, "存在", "", MB_OK);
}
else
{
MessageBox(NULL, "不存在,那就创建一个", "", MB_OK);
CreateDirectory("E:\\Visual Studio 2013\\Projects\\test\\abc", NULL);
}
cin.get();
return 0;
}
博客介绍了在MFC中使用PathFileExists()和CreateDirectory()的相关配置。需要包含头文件shlwapi.h,链接库Shlwapi.lib,为MFC开发提供了关键的信息技术配置信息。
430

被折叠的 条评论
为什么被折叠?



