0
我正在创建一个VC++ 2008 Windows窗体应用程序,它需要使用我们的VC6项目中的一些类。将代码从VC++ 6移动到VC++ 2008时出错
当我增加了一个文件,其中包含下面的方法:
bool Property::createPaths(string &sPaths)
{
char *tok = NULL;
char seps[] = "\\";
string str;
if (sPaths.size() > 0)
{
tok = strtok((char*)sPaths.c_str(),seps);
str = tok;
while (tok != NULL)
{
int res = CreateDirectory(str.c_str(),NULL);
tok = strtok(NULL,seps);
if (tok != NULL)
{
str += "\\";
str += tok;
}
}
return true;
}
return false;
}
我得到错误抱怨CreateDirectory电话:
* 错误C2664: 'CreateDirectory':不能从转换参数1 'const char '至'LPCTSTR'
在线搜索,似乎我需要一些配置配给我的VC2008项目来解决这个问题。任何人都可以告诉我在哪里以及如何?
+1,十分钟没有回答,所以我写了一个你打败了我。 –