I am creating a VC++2008 Windows Form Application which needs to use some of classes from our VC6 project.
When I added one file which contains the following method:
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;
}
I got error complain the CreateDirectory call:
*error C2664: 'CreateDirectory' : cannot convert parameter 1 from 'const char ' to 'LPCTSTR'
Searched online, seems I need some configuration on my VC2008 project to fix this. Anybody can tell me where and how?