[Résolu][C++] un pb pour supprimer un rep et son contenu
je comprends pas un truc, je recherche en fait à supprimer un répertoire et son contenu avec le code suivant :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
bool myDeleteDirectory(LPCTSTR repertoire, bool suppressionDefinitive = true)
{
SHFILEOPSTRUCT sh;
sh.hwnd = NULL;
sh.wFunc = FO_DELETE;
sh.pFrom = repertoire;
sh.pTo = NULL;
sh.fFlags = FOF_NOCONFIRMATION|FOF_SILENT;
if(!suppressionDefinitive)
sh.fFlags |= FOF_ALLOWUNDO;
sh.fAnyOperationsAborted = FALSE;
sh.lpszProgressTitle = NULL;
sh.hNameMappings = NULL;
return (SHFileOperation(&sh)==0);
} |
Cela marche en local avec des chemins du genre "C:\\xxx\\yyy"
mais en réseau "\\Machine\\xxx\yyy" cela ne fonctionne pas pourquoi?
Merci