- prgchDirPath 是字符指针。但预期的是 LPCWSTR。如何改变这个?
prgchDirPath 是目录路径。文件不存在。但我想确定目录/路径是否存在。下面的 API 可以帮助我吗?如果是,如何?
unsigned char IsFilePathCorrect(char* prgchDirPath) { WIN32_FIND_DATA FindFileData; HANDLE handle; int found=0; //1. prgchDirPath is char pointer. But expected is LPCWSTR. //How to change this? //2. prgchDirPath is a directory path. File is not existed. //But I want to make sure if directory/path exists or not. //Can the API below helps me? if yes, how? handle = FindFirstFile(prgchDirPath, &FindFileData); if(handle != INVALID_HANDLE_VALUE) found = 1; if(found) { FindClose(handle); } return found; }
我想检查目录路径是否存在。请提供一个示例代码。谢谢你。