1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
char DRVLTR[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
char* tdrv = new char[5];
char tpath[MAX_PATH];
for (int y = 0; y < 26; y++){
tdrv[0] = '\0';
tpath[0] = '\0';
strncat(tdrv, DRVLTR[y], 5); //Cannot convert char to const char
strncat(tdrv, ":\\", 5);
strncat(tpath, DRVLTR, MAX_PATH);
strncat(tpath, "Windows\\", MAX_PATH);
if (dir_exists(tpath)){
return tdrv;
}
}
|